Determines slotInParent from the ERD of the infoset element arg.
Determines slotInParent from the ERD of the infoset element arg. Hooks up the parent pointer of the new child to reference this.
When slot contains an array, this appends to the end of the array.
Can treat any DINode, even simple ones, as a container of other nodes.
Copy method keeps these objects null to avoid allocation unless they are really needed.
Copy method keeps these objects null to avoid allocation unless they are really needed.
Copy method keeps these objects null to avoid allocation unless they are really needed.
Copy method keeps these objects null to avoid allocation unless they are really needed.
Note: there is no infoset data member for isHidden.
Note: there is no infoset data member for isHidden. A hidden group is a DFDL schema characteristic for a model group. Elements inside it will have (their element base) isHidden statically on the schema. So there is no notion of creating an infoset element then making it hidden by marking it in some way. Rather, the corresponding elementRuntimeData tells you whether it is hidden or not.
When we convert to XML, then if we want to preserve information about things being hidden (for inspection by looking at the XML) then we need to add an attribute. But for the infoset itself, we don't need it.
Tells if the element is nilled or not.
Tells if the element is nilled or not.
Throws InfosetNoDataException if we don't yet know if it is nil or not (i.e., hasn't be set, nor has anything been set to indicate that it won't be nilled.)
Used for just testing whether a node has the nil indicators set.
Used for just testing whether a node has the nil indicators set. That is, dodges the expression evaluation complexity where specific exceptions are thrown when you ask about data that isn't known yet.
use to require it be finalized or throw the appropriate Array or Complex exception.
use to require it be finalized or throw the appropriate Array or Complex exception.
Retrieve the schema component that gave rise to this infoset item.
Retrieve the schema component that gave rise to this infoset item.
This is purely to make debugging easier.
This is purely to make debugging easier.
The totalElementCount is the total count of how many elements this InfosetItem contains.
The totalElementCount is the total count of how many elements this InfosetItem contains.
(Used to call this 'size', but size is often a length-like thing, so changed name to be more distinctive)
valid = Nope means not checked valid = One(true) means valid valid = One(false) means invalid
valid = Nope means not checked valid = One(true) means valid valid = One(false) means invalid
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.