ExternalDataInstance class final
A secondary instance loaded from a src URI (jr://file/…,
jr://file-csv/…, GeoJSON, or an InstanceProvider).
Port of org.javarosa.core.model.instance.ExternalDataInstance. A
missing or empty file is replaced by a placeholder top-level element
named missing file, so forms still load.
- Inheritance
-
- Object
- DataInstance
- ExternalDataInstance
Properties
- base → TreeElement
-
The hidden node above the top-level element.
no setteroverride
- 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
- isUsingPlaceholder → bool
-
Whether the file was missing or empty and a placeholder is used.
final
- name ↔ String?
-
The instance name used by EvaluationContext.instanceNamed lookups.
getter/setter pairinherited
- path → String
-
The
srcthe instance was loaded from.final - root → TreeElement
-
The top-level element.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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 -
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? -
Resolves
ref; when the resolved element is partial, the full instance is loaded andrefresolved again. (As in JavaRosa, only the resolved element itself is checked, not its ancestors.)override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
build(
ResourceResolver resolver, String instanceSrc, String instanceId, {ExternalInstanceParser? parser, bool placeholderIfMissing = true}) → Future< ExternalDataInstance> -
Loads the instance
instanceIdfrominstanceSrcwithparser(default: ExternalInstanceParser with its CSV and GeoJSON parsers), reading files throughresolver.
Constants
- placeholderName → const String
- Name of the placeholder top-level element.