Package org.rumbledb.items.xml
Class DocumentItem
java.lang.Object
org.rumbledb.items.xml.DocumentItem
- All Implemented Interfaces:
com.esotericsoftware.kryo.KryoSerializable,Serializable,Item
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentItem(List<Item> children) Constructor for creating a document node with children items.DocumentItem(Node documentNode, List<Item> children) -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod sets the parent item for all descendents of the current item.XDM 3.1 Section 5.12 string-value Accessor.XDM 3.1 Section 6.1 Document Node Accessors — attributes.baseUri()XDM 3.1 Section 6.1 Document Node Accessors — base-uri.children()XDM 3.1 Section 5.3 children Accessor.Helper accessor for XML element nodes: returns namespace nodes for the namespace bindings declared directly on the element.XDM 3.1 Section 6.1 Document Node Accessors — document-uri.booleanTests for logical equality.Returns the dynamic type of the item (only for error message purposes).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 / uniquenessinthashCode()Computes a hash code.booleanTests whether the item is an XML Document node.booleanisId()XDM 3.1 Section 6.1 Document Node Accessors — is-id.booleanisIdrefs()XDM 3.1 Section 6.1 Document 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.1 Document Node Accessors — nilled.nodeKind()XDM 3.1 Section 6.1 Document Node Accessors — node-kind.nodeName()XDM 3.1 Section 6.1 Document Node Accessors — node-name.parent()XDM 3.1 Section 5.11 parent Accessor.voidread(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) intsetXmlDocumentPosition(String path, int current) Set the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniquenessXDM 3.1 Section 6.1 Document Node Accessors — typed-value.typeName()XDM 3.1 Section 6.1 Document Node Accessors — type-name.unparsedEntityPublicId(String name) XDM 3.1 Section 6.1 Document Node Accessors — unparsed-entity-public-id.unparsedEntitySystemId(String name) XDM 3.1 Section 6.1 Document Node Accessors — unparsed-entity-system-id.voidwrite(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.rumbledb.api.Item
append, appendItem, appendSequence, castToDecimalValue, castToDoubleValue, castToFloatValue, castToIntegerValue, castToIntValue, generateNativeQuery, getBinaryValue, getBodyIterator, getBooleanValue, getCollection, getContent, getDateTimeValue, getDay, getDecimalValue, getDFVariablesInClosure, getDoubleValue, getDurationValue, getEffectiveBooleanValue, getEpochMillis, getEstimator, getFloatValue, getHour, getIdentifier, getIntegerValue, getIntValue, getItemAt, getItemByKey, getItemByKey, getItemKeys, getItemMembers, getItems, getItemValues, getKeys, getLocalVariablesInClosure, getMinute, getModuleDynamicContext, getMonth, getMutabilityLevel, getNanosecond, getOffset, getParameterNames, getPathIn, getPeriodValue, getQNameValue, getRDDVariablesInClosure, getSecond, getSequenceAt, getSequenceByKey, getSequenceByKey, getSequenceMembers, getSequenceValues, getSignature, getSize, getSparkSQLType, getSparkSQLValue, getSparkSQLValue, getStringKeys, getTableLocation, getTextValue, getTimeValue, getTopLevelID, getTopLevelOrder, getTransformer, getValues, getVariantValue, getYear, hasDateTime, hasTimeZone, isAnyURI, isArray, isArrayOfItems, isAtomic, isAttributeNode, isBase64Binary, isBinary, isBoolean, isBuiltinFunction, isCommentNode, isDate, isDateTime, isDayTimeDuration, isDecimal, isDouble, isDuration, isElementNode, isEstimator, isFloat, isFunction, isGDay, isGMonth, isGMonthDay, isGYear, isGYearMonth, isHexBinary, isInt, isInteger, isMap, isNamespaceNode, isNaN, 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, setParent, setPathIn, setTableLocation, setTopLevelID, setTopLevelOrder
-
Constructor Details
-
DocumentItem
public DocumentItem() -
DocumentItem
-
DocumentItem
Constructor for creating a document node with children items. Used by document node constructors when no actual DOM node is available.- Parameters:
children- the child nodes of the document
-
-
Method Details
-
setXmlDocumentPosition
Description copied from interface:ItemSet the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness- Specified by:
setXmlDocumentPositionin interfaceItem- 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- Specified by:
getXmlDocumentPositionin interfaceItem- 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.- Specified by:
addParentToDescendantsin interfaceItem
-
write
public void write(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Output output) - Specified by:
writein interfacecom.esotericsoftware.kryo.KryoSerializable
-
read
public void read(com.esotericsoftware.kryo.Kryo kryo, com.esotericsoftware.kryo.io.Input input) - Specified by:
readin interfacecom.esotericsoftware.kryo.KryoSerializable
-
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." -
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.- Specified by:
getStringValuein interfaceItem- Returns:
- the string value.
-
getDynamicType
Description copied from interface:ItemReturns the dynamic type of the item (only for error message purposes).- Specified by:
getDynamicTypein interfaceItem- Returns:
- the dynamic type as an item type.
-
equals
Description copied from interface:ItemTests for logical equality. The semantics are that of the eq operator. -
isNode
public boolean isNode()Description copied from interface:ItemTests whether the item is an XML node. -
isDocumentNode
public boolean isDocumentNode()Description copied from interface:ItemTests whether the item is an XML Document node.- Specified by:
isDocumentNodein interfaceItem- Returns:
- true if it is an XML Document node, false otherwise.
-
nodeKind
XDM 3.1 Section 6.1 Document Node Accessors — node-kind. "For a Document Node, dm:node-kind returns the string \"document\"." -
nodeName
XDM 3.1 Section 6.1 Document Node Accessors — node-name. "For a Document Node, dm:node-name returns the empty sequence." -
attributes
XDM 3.1 Section 6.1 Document Node Accessors — attributes. "For a Document Node, dm:attributes returns the empty sequence."- Specified by:
attributesin interfaceItem
-
baseUri
XDM 3.1 Section 6.1 Document Node Accessors — base-uri. "For a Document Node, dm:base-uri returns the base URI of the document node, if it has one; otherwise it returns the empty sequence." RumbleDB does not currently track base URIs for document nodes, so this implementation returns null to represent the empty sequence. -
documentUri
XDM 3.1 Section 6.1 Document Node Accessors — document-uri. "For a Document Node, dm:document-uri returns the document-uri property of the document node, if it has one; otherwise it returns the empty sequence." RumbleDB does not currently track document URIs, so this implementation returns null to represent the empty sequence.- Specified by:
documentUriin interfaceItem
-
isId
public boolean isId()XDM 3.1 Section 6.1 Document Node Accessors — is-id. For a Document Node, dm:is-id returns false. -
isIdrefs
public boolean isIdrefs()XDM 3.1 Section 6.1 Document Node Accessors — is-idrefs. For a Document Node, dm:is-idrefs returns false. -
nilled
XDM 3.1 Section 6.1 Document Node Accessors — nilled. For a Document Node, dm:nilled returns the empty sequence. -
typeName
XDM 3.1 Section 6.1 Document Node Accessors — type-name. For a Document Node, dm:type-name returns the empty sequence. -
typedValue
XDM 3.1 Section 6.1 Document Node Accessors — typed-value. For a Document Node, dm:typed-value returns the typed value of the document node as a sequence of zero or more atomic values. This implementation delegates to atomizedValue().- Specified by:
typedValuein interfaceItem
-
unparsedEntityPublicId
XDM 3.1 Section 6.1 Document Node Accessors — unparsed-entity-public-id. For a Document Node, dm:unparsed-entity-public-id returns the public identifier of an unparsed entity with a given name in the document, or the empty sequence if there is no such entity or if it has no public identifier. RumbleDB does not currently support unparsed entities, so this implementation always returns the empty sequence.- Specified by:
unparsedEntityPublicIdin interfaceItem
-
unparsedEntitySystemId
XDM 3.1 Section 6.1 Document Node Accessors — unparsed-entity-system-id. For a Document Node, dm:unparsed-entity-system-id returns the system identifier of an unparsed entity with a given name in the document, or the empty sequence if there is no such entity or if it has no system identifier. RumbleDB does not currently support unparsed entities, so this implementation always returns the empty sequence.- Specified by:
unparsedEntitySystemIdin interfaceItem
-
hashCode
public int hashCode()Description copied from interface:ItemComputes a hash code. -
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().- Specified by:
atomizedValuein interfaceItem
-
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.- Specified by:
namespaceNodesin interfaceItem
-
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.- Specified by:
declaredNamespaceNodesin interfaceItem
-