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

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 (version attribute).
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
instanceId ↔ String?
The instance id (instance('id')), null for 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 xmlns of the top-level element).
getter/setter pair
uiVersion ↔ String?
UI version (uiVersion attribute).
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) to to, which may be unbound in its last step to append a new instance.
copyNodeAt(TreeReference from, TreeReference to) → TreeReference
Copies the element at from to to (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; null if 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 ref following 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 instanceId when the form starts. Port of FormInstance.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 ref points to, or null if 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 a and b have the same (non-repeat) structure.