Complex elements have an array of slots one per named child element.
Base for non-array elements.
Base for non-array elements. That is either scalar or optional ( minOccurs 0, maxOccurs 1)
Arrays and complex elements have a notion of being finalized, when unparsing.
Arrays and complex elements have a notion of being finalized, when unparsing. This is when we know that no more elements will be added to them, so things like fn:count can return a value knowing it won't change, and fn:exists can return false, knowing nobody will subsequently append the item that was being questioned.
Base for all terms, as there are these pseudo-nodes like DISequence which can have runtime-valued properties, but which aren't infoset items.
Used to determine if expressions can be evaluated without any nodes.
Used to determine if expressions can be evaluated without any nodes. They all save/restore the current node, so this is the placeholder they use for that purpose.
An infoset event accessor.
An infoset event accessor.
Not a case class because we don't want pattern matching on this. (It allocates to pattern match)
Indicates that an expression evaluated to a node sequence of more than one value.
Indicates that an expression evaluated to a node sequence of more than one value. This results in a schema definition error at runtime.
Don't catch this one.
Don't catch this one. It's not restartable.
Indicates for simple types that there is no value, and has not been setNilled.
Indicates for simple types that there is no value, and has not been setNilled.
For complex types indicates has not been setNilled.
Exception thrown if infoset doesn't have a child corresponding to the slot being probed.
Exception thrown if infoset doesn't have a child corresponding to the slot being probed. E.g., expression evaluation reaching to a forward sibling that has not yet been parsed.
This is thrown if an expression is evaluated at the wrong place Eg., in the debugger if you set a breakpoint, and then
This is thrown if an expression is evaluated at the wrong place Eg., in the debugger if you set a breakpoint, and then
condition 1 xsd:string(.) eq '3'
Well that condition expression is going to get evaluated even at times when "." is bound to a DIComplex node. (The focus of "." seems to not be assured of being on the breakpoint node. This expression can get evaluated at least when "." is the parent of the breakpoint element.)
These are all case classes so we get the automatic equals function that compares the constructor args for equality.
Keeps track of where we are for computing either the value length or content length.
Keeps track of where we are for computing either the value length or content length. Serves to cache this information on the infoset element.
Note that this is used to capture and restore this state also, in which case the ie argument is null.
These 4 members are used to allow computation of e.g., contentLength but in a manner than can block if it is unable to be computed yet.
If only the maybeStartPos... is defined, AND the corresponding data output stream is NOT defined then it is an absolute position. If both the maybeStartPos... is defined AND the corresponding maybeStartDataOutputStream are defined, then that start pos is a relative start pos, and we'll need to compute the absolute start pos once we find out the absolute start pos of the data output stream.
The schema compiler computes this for each element.
The schema compiler computes this for each element.
This is for use assembling the Daffodil Infoset from an InfosetInputter. Note that not all InfosetInputter's have a concept of namespaces (json is a prime example of this). In order to support this, each nextElement method has a variable called hasNamespace, which is used to specify whether or not the InfosetInputter supports namespaces. If it does not support namespaces, then the namespace parameter should be ignored. This may affect how the next element is determined, and may result in an UnparseError in some cases.
Ignores all infoset events, outputting nothing
Thrown when unparsing and demanding the dataValue of a DISimple when there is no value yet, but the element has dfdl:outputValueCalc expression.
Thrown when unparsing and demanding the dataValue of a DISimple when there is no value yet, but the element has dfdl:outputValueCalc expression.
This should be caught in contexts that want to undertake on-demand evaluation of the OVC expression.
Marker trait that identifies exceptions which indicate an action that can block forward-referencing expressions that occur during unparsing.
Marker trait that identifies exceptions which indicate an action that can block forward-referencing expressions that occur during unparsing. These actions can be retried once the available information has "arrived" in the infoset or the state of the unparser.
Schema compiler computes the map here, and then attaches this object to the ERD of each element.
Writes the infoset to a java.io.Writer as XML text.
Complex elements have an array of slots one per named child element.
TODO: consider xs:choice - alternatives could share slots, but that would add a lot of complexity, and the nil technique of storing null in a slot to indicate a nilled element only works if we have a positive association of slots to element-bases. If we were to share slots we'd need a different way to indicate nil. A better approach for xs:choice would be a sparse table of slots (whenever there are more than N - some threshold), so that we're not allocating arrays of 200 slots just because there are 200 branches of a choice.
A slot stores a Maybe[InfosetCommonMixin]. None means not present (yet, because it hasn't been parsed yet, or it is an optional element (minOccurs 0, maxOccurs 1) and is not present.) One[DISimple] or One[DIComplex] mean a required element is present, or an optional element (minOccurs 0, maxOccurs 1) is present.
A slot of a DIComplex should never be null.
One[DIArray] means the slot is for a recurring element which can have 2+ instances. The DIArray object's length gives the number of occurrences.