FormInstance class
The main instance of a form (also used for inline secondary instances).
Port of org.javarosa.core.model.instance.FormInstance (without
storage and metadata plumbing).
- Inheritance
-
- Object
- DataInstance
- FormInstance
Constructors
- FormInstance([TreeElement? root, String? instanceId])
-
Creates an instance whose top-level element is
root.
Properties
- base → TreeElement
-
The hidden node above the top-level element.
no setteroverride
- formVersion ↔ String?
-
Form version (
versionattribute).getter/setter pair - hashCode → int
-
The hash code for this object.
no setterinherited
- instanceId ↔ String?
-
The instance id (
instance('id')),nullfor the main instance.getter/setter pairinherited - isRuntimeEvaluated → bool
-
Whether the instance's content is computed at evaluation time.
no setterinherited
- name ↔ String?
-
The instance name used by EvaluationContext.instanceNamed lookups.
getter/setter pairinherited
-
namespaces
→ Map<
String, String> -
Namespace prefixes declared on the instance, prefix → URI.
final
- root → TreeElement
-
The top-level element. Throws if there is none, as JavaRosa does.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- schema ↔ String?
-
Form schema (the
xmlnsof the top-level element).getter/setter pair - uiVersion ↔ String?
-
UI version (
uiVersionattribute).getter/setter pair
Methods
-
clone(
) → FormInstance -
A deep copy (templates included) with the same schema, versions and
namespaces. Port of
FormInstance.clone(storage fields aren't ported). -
copyNode(
TreeElement source, TreeReference to) → TreeElement -
Copies
source(without templates) toto, which may be unbound in its last step to append a new instance. -
copyNodeAt(
TreeReference from, TreeReference to) → TreeReference -
Copies the element at
fromtoto(a new repeat instance); returns the new element's reference. -
explodeReference(
TreeReference ref) → List< TreeElement> ? -
The elements along
ref, excluding the base and the final node;nullif any step can't be resolved.inherited -
getTemplate(
TreeReference ref) → TreeElement? -
The repeat template (or attribute) at
ref, if any.inherited -
getTemplatePath(
TreeReference ref) → TreeElement? -
The node at
reffollowing templates where present, otherwise the first instance of each step.inherited -
hasTemplatePath(
TreeReference ref) → bool -
Whether some template or instance path matches
ref.inherited -
initialize(
String instanceId) → void -
Names this secondary instance
instanceIdwhen the form starts. Port ofFormInstance.initialize. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replacePartialElements(
List< TreeElement> elements) → void -
Fills partial top-level elements with
elements' content.inherited -
resolveReference(
TreeReference ref) → TreeElement? -
The element
refpoints to, ornullif it doesn't exist or is ambiguous. Never returns the hidden base node.inherited -
setRoot(
TreeElement? topLevel) → void -
Replaces the top-level element with
topLevel. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
isHomogeneous(
TreeElement a, TreeElement b) → bool -
Whether
aandbhave the same (non-repeat) structure.