Package org.rumbledb.items.xml
Class ElementItem
java.lang.Object
org.rumbledb.items.xml.AbstractNodeItem
org.rumbledb.items.xml.ElementItem
- All Implemented Interfaces:
Serializable,Item
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOrReplaceNamespace(Item namespaceItem) voidMethod sets the parent item for all descendents of the current item.XDM 3.1 Section 5.12 string-value Accessor.XDM 3.1 Section 5.1 attributes Accessor.baseUri()XDM 3.1 Section 6.2 Element Node Accessors — base-uri.children()XDM 3.1 Section 5.3 children Accessor.voidRemoves a node's schema annotation and restores its untyped typed-value behavior.copy(boolean mutable) Makes a copy.Helper accessor for XML element nodes: returns namespace nodes for the namespace bindings declared directly on the element.voiddeclareNamespaceBinding(String prefix, String uri) Declares or overrides a namespace binding on this element without rewriting the element name.XDM 3.1 Section 6.2 Element Node Accessors — document-uri.Returns the dynamic type of the item (only for error message purposes).booleanReturns the effective boolean value of the item, if atomic.Returns the string value of the item, if it is an atomic item.Get the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniquenessbooleanTests whether the item is an XML Element node.booleanisId()XDM 3.1 Section 6.2 Element Node Accessors — is-id.booleanisIdrefs()XDM 3.1 Section 6.2 Element Node Accessors — is-idrefs.booleanisNode()Tests whether the item is an XML node.XDM 3.1 Section 5.7 namespace-nodes Accessor.nilled()XDM 3.1 Section 6.2 Element Node Accessors — nilled.nodeKind()XDM 3.1 Section 6.2 Element Node Accessors — node-kind.nodeName()XDM 3.1 Section 5.10 node-name Accessor.parent()XDM 3.1 Section 5.11 parent Accessor.voidsetDeclaredNamespaces(Map<String, String> namespaces) voidsetNodeName(Name nodeName) Updates the element node-name after namespace fixup chooses a non-conflicting prefix.voidvoidsetSchemaType(@NonNull XmlSchemaTypeAnnotation typeAnnotation) Sets an element node's schema type annotation when its typed value is unavailable.voidsetSchemaType(@NonNull XmlSchemaTypeAnnotation typeAnnotation, List<Item> typedValue) Sets a node's schema type annotation together with its XDM typed value.intsetXmlDocumentPosition(String path, int current) Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniquenessvoidsetXmlSchemaIdentityProperties(boolean id, boolean idRefs) Records the ID and IDREF properties supplied by XML Schema validation.voidsetXmlSchemaNilled(boolean nilled) Records the nilled property supplied by XML Schema validation.XDM 3.1 Section 6.2 Element Node Accessors — typed-value.typeName()XDM 3.1 Section 6.2 Element Node Accessors — type-name.Methods inherited from class org.rumbledb.items.xml.AbstractNodeItem
equals, hashCodeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rumbledb.api.Item
appendItem, appendSequence, castToDecimalValue, castToDoubleValue, castToFloatValue, castToIntegerValue, castToIntValue, generateNativeQuery, getBinaryValue, getBodyIterator, getBooleanValue, getCollection, getContent, getDateTimeValue, getDay, getDayTimeDurationComponent, getDecimalValue, getDFVariablesInClosure, getDoubleValue, getDurationValue, getEpochMillis, getEstimator, getFloatValue, getHour, getIdentifier, getIntegerValue, getIntValue, getItemAt, getItemByKey, getItemByKey, getItemKeys, getItemMembers, getItemValues, getLocalVariablesInClosure, getMinute, getModuleDynamicContext, getMonth, getMutabilityLevel, getNanosecond, getNotationValue, getOffset, getParameterNames, getPathIn, getPeriodValue, getQNameValue, getRDDVariablesInClosure, getSecond, getSequenceAt, getSequenceByKey, getSequenceByKey, getSequenceMembers, getSequenceValues, getSignature, getSize, getSparkSQLType, getSparkSQLValue, getSparkSQLValue, getStringKeys, getTableLocation, getTextValue, getTimeValue, getTopLevelID, getTopLevelOrder, getTransformer, getVariantValue, getYear, hasDateTime, hasKey, hasKey, hasTimeZone, isAnyURI, isArray, isArrayOfItems, isAtomic, isAttributeNode, isBase64Binary, isBinary, isBoolean, isBuiltinFunction, isCommentNode, isDate, isDateTime, isDayTimeDuration, isDecimal, isDocumentNode, isDouble, isDuration, isEstimator, isFloat, isFunction, isGDay, isGMonth, isGMonthDay, isGYear, isGYearMonth, isHexBinary, isInt, isInteger, isMap, isNamespaceNode, isNaN, isNotation, isNull, isNumeric, isObject, isPeriod, isProcessingInstructionNode, isQName, isString, isTextNode, isTime, isTransformer, isUntypedAtomic, isYearMonthDuration, physicalEquals, putItemAt, putItemByKey, putItemByKey, putItemsAt, putLazyItemByKey, putSequenceAt, putSequenceByKey, putSequenceByKey, putSequencesAt, removeItemAt, removeItemByKey, removeItemByKey, removeSequenceAt, serialize, serializeAsJSON, setCollection, setMutabilityLevel, setPathIn, setTableLocation, setTopLevelID, setTopLevelOrder, unparsedEntityPublicId, unparsedEntitySystemId
-
Constructor Details
-
ElementItem
Constructed element with a resolved expanded name (e.g. from XQuery direct/computed constructors). -
ElementItem
-
ElementItem
-
-
Method Details
-
copy
Description copied from interface:ItemMakes a copy.- Parameters:
mutable- whether the copy should be mutable (if supported by the item).- Returns:
- a copy
-
setXmlDocumentPosition
Description copied from interface:ItemSet the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness- Parameters:
path- the path of the XML documentcurrent- the current position- Returns:
- the new position
-
getXmlDocumentPosition
Description copied from interface:ItemGet the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness- Returns:
- the XML document position
-
addParentToDescendants
public void addParentToDescendants()Description copied from interface:ItemMethod sets the parent item for all descendents of the current item. -
isNode
public boolean isNode()Description copied from interface:ItemTests whether the item is an XML node.- Returns:
- true if it is an XML node, false otherwise.
-
isElementNode
public boolean isElementNode()Description copied from interface:ItemTests whether the item is an XML Element node.- Returns:
- true if it is an XML Element node, false otherwise.
-
attributes
Description copied from interface:ItemXDM 3.1 Section 5.1 attributes Accessor. dm:attributes($n as node()) as attribute()* "The dm:attributes accessor returns the dynamic, unordered set of attribute nodes that have the node as their parent. It is defined only on element and document nodes; for other node kinds it returns the empty sequence." -
children
Description copied from interface:ItemXDM 3.1 Section 5.3 children Accessor. dm:children($n as node()) as node()* "The dm:children accessor returns the dynamic, ordered sequence of child nodes of the node. It is defined on all node kinds except attribute and namespace nodes; for those node kinds it returns the empty sequence." -
nodeKind
XDM 3.1 Section 6.2 Element Node Accessors — node-kind. "For an Element Node, dm:node-kind returns the string \"element\"." -
baseUri
XDM 3.1 Section 6.2 Element Node Accessors — base-uri. "For an Element Node, dm:base-uri returns the base URI of the element node, if it has one; otherwise it returns the empty sequence." -
documentUri
XDM 3.1 Section 6.2 Element Node Accessors — document-uri. "For an Element Node, dm:document-uri returns the document URI of the document node that is the root of the tree containing the element, if it has one; otherwise it returns the empty sequence." This implementation delegates to the parent, if any, otherwise returns null. -
declaredNamespaceNodes
Description copied from interface:ItemHelper accessor for XML element nodes: returns namespace nodes for the namespace bindings declared directly on the element. This does not include inherited or statically known namespaces — only the bindings explicitly declared on the element (for example via xmlns attributes). Non-element nodes must override this to return the empty sequence. -
namespaceNodes
Description copied from interface:ItemXDM 3.1 Section 5.7 namespace-nodes Accessor. dm:namespace-nodes($n as node()) as namespace-node()* "The dm:namespace-nodes accessor returns the dynamic, unordered set of Namespace Nodes. It is defined on all seven node kinds." This default implementation is only a placeholder on the generic Item interface and must be overridden by XML node implementations that support namespaces. -
isId
public boolean isId()XDM 3.1 Section 6.2 Element Node Accessors — is-id. For schema-validated elements, this reflects whether the typed value is derived from xs:ID. -
isIdrefs
public boolean isIdrefs()XDM 3.1 Section 6.2 Element Node Accessors — is-idrefs. For schema-validated elements, this reflects whether the typed value contains a value derived from xs:IDREF. -
nilled
XDM 3.1 Section 6.2 Element Node Accessors — nilled. "For an Element Node, dm:nilled returns true if the element is nilled, false if it is not nilled." Schema-validated elements return true if marked as nilled in the PSVI. Untyped or unvalidated elements always return false per XDM 3.1 Section 6.2.1 constraint 10. -
nodeName
Description copied from interface:ItemXDM 3.1 Section 5.10 node-name Accessor. dm:node-name($n as node()) as xs:QName? "The dm:node-name accessor returns the name of the node as an xs:QName, or the empty sequence if the node does not have a name."- Returns:
- the expanded name (
Name) of the node, ornullwhen the accessor yields the empty sequence
-
parent
Description copied from interface:ItemXDM 3.1 Section 5.11 parent Accessor. dm:parent($n as node()) as node()? "The dm:parent accessor returns the parent of the node, or the empty sequence if the node has no parent." -
getStringValue
Description copied from interface:ItemReturns the string value of the item, if it is an atomic item.- Returns:
- the string value.
-
getDynamicType
Description copied from interface:ItemReturns the dynamic type of the item (only for error message purposes).- Returns:
- the dynamic type as an item type.
-
setParent
-
typeName
XDM 3.1 Section 6.2 Element Node Accessors — type-name. "For an Element Node, dm:type-name returns the name of the dynamic type of the element node, or the empty sequence if the node is untyped." -
typedValue
XDM 3.1 Section 6.2 Element Node Accessors — typed-value. "For an Element Node, dm:typed-value returns the typed value of the element node as a sequence of zero or more atomic values." -
setSchemaType
Description copied from interface:ItemSets an element node's schema type annotation when its typed value is unavailable.- Parameters:
typeAnnotation- the schema type annotation
-
setSchemaType
public void setSchemaType(@NonNull @NonNull XmlSchemaTypeAnnotation typeAnnotation, List<Item> typedValue) Description copied from interface:ItemSets a node's schema type annotation together with its XDM typed value.- Parameters:
typeAnnotation- the schema type annotationtypedValue- the typed value, including an empty list for a valid empty typed value
-
clearSchemaType
public void clearSchemaType()Description copied from interface:ItemRemoves a node's schema annotation and restores its untyped typed-value behavior. -
getSchemaTypeAnnotation
- Returns:
- this node's XML Schema annotation, or
nullwhen the node is untyped.
-
setXmlSchemaNilled
public void setXmlSchemaNilled(boolean nilled) Description copied from interface:ItemRecords the nilled property supplied by XML Schema validation. -
setXmlSchemaIdentityProperties
public void setXmlSchemaIdentityProperties(boolean id, boolean idRefs) Description copied from interface:ItemRecords the ID and IDREF properties supplied by XML Schema validation. -
addOrReplaceNamespace
-
declareNamespaceBinding
Declares or overrides a namespace binding on this element without rewriting the element name. This is used by constructor namespace-fixup after any necessary prefix rewrites have already been decided. -
setDeclaredNamespaces
-
setNodeName
Updates the element node-name after namespace fixup chooses a non-conflicting prefix. -
atomizedValue
Description copied from interface:ItemXDM 3.1 Section 5.12 string-value Accessor. dm:string-value($n as node()) as xs:string "The dm:string-value accessor returns the string-value of the node as defined for each node kind." In this API, node string values are exposed via getStringValue() and the default implementation of dm:typed-value delegates to atomizedValue(). -
getEffectiveBooleanValue
public boolean getEffectiveBooleanValue()Description copied from interface:ItemReturns the effective boolean value of the item, if atomic.- Returns:
- the effective boolean value.
-