Class AttributeItem

java.lang.Object
org.rumbledb.items.xml.AbstractNodeItem
org.rumbledb.items.xml.AttributeItem
All Implemented Interfaces:
Serializable, Item

public class AttributeItem extends AbstractNodeItem
See Also:
  • Constructor Details

    • AttributeItem

      public AttributeItem(Node attributeNode)
    • AttributeItem

      public AttributeItem(Name dmNodeName, String stringValue)
  • Method Details

    • copy

      public Item copy(boolean mutable)
      Description copied from interface: Item
      Makes a copy.
      Parameters:
      mutable - whether the copy should be mutable (if supported by the item).
      Returns:
      a copy
    • setXmlDocumentPosition

      public int setXmlDocumentPosition(String path, int current)
      Description copied from interface: Item
      Set 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 document
      current - the current position
      Returns:
      the new position
    • getXmlDocumentPosition

      public XMLDocumentPosition getXmlDocumentPosition()
      Description copied from interface: Item
      Get the position of the Node inside the XML document (and path incase of multiple docs) for sorting / uniqueness
      Returns:
      the XML document position
    • nodeName

      public Name nodeName()
      Description copied from interface: Item
      XDM 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, or null when the accessor yields the empty sequence
    • parent

      public Item parent()
      Description copied from interface: Item
      XDM 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

      public String getStringValue()
      Description copied from interface: Item
      Returns the string value of the item, if it is an atomic item.
      Returns:
      the string value.
    • setParent

      public void setParent(Item parent)
    • setNodeName

      public void setNodeName(Name nodeName)
    • addParentToDescendants

      public void addParentToDescendants()
      Description copied from interface: Item
      Method sets the parent item for all descendents of the current item.
    • getDynamicType

      public ItemType getDynamicType()
      Description copied from interface: Item
      Returns the dynamic type of the item (only for error message purposes).
      Returns:
      the dynamic type as an item type.
    • nodeKind

      public String nodeKind()
      XDM 3.1 Section 6.3 Attribute Node Accessors — node-kind. "For an Attribute Node, dm:node-kind returns the string \"attribute\"."
    • children

      public List<Item> children()
      XDM 3.1 Section 6.3 Attribute Node Accessors — children. "For an Attribute Node, dm:children returns the empty sequence."
    • attributes

      public List<Item> attributes()
      XDM 3.1 Section 6.3 Attribute Node Accessors — attributes. "For an Attribute Node, dm:attributes returns the empty sequence."
    • isId

      public boolean isId()
      XDM 3.1 Section 6.3 Attribute Node Accessors — is-id. "For an Attribute Node, dm:is-id returns true if the attribute node is of type xs:ID or is derived by restriction from xs:ID; otherwise it returns false."
    • isIdrefs

      public boolean isIdrefs()
      XDM 3.1 Section 6.3 Attribute Node Accessors — is-idrefs. "For an Attribute Node, dm:is-idrefs returns true if the attribute node is of type xs:IDREF or xs:IDREFS or is derived by restriction from one of these types; otherwise it returns false."
    • isNode

      public boolean isNode()
      Description copied from interface: Item
      Tests whether the item is an XML node.
      Returns:
      true if it is an XML node, false otherwise.
    • isAttributeNode

      public boolean isAttributeNode()
      Description copied from interface: Item
      Tests whether the item is an XML Attribute node.
      Returns:
      true if it is an XML Attribute node, false otherwise.
    • atomizedValue

      public List<Item> atomizedValue()
      Description copied from interface: Item
      XDM 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().
    • namespaceNodes

      public List<Item> namespaceNodes()
      Description copied from interface: Item
      XDM 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.
    • declaredNamespaceNodes

      public List<Item> declaredNamespaceNodes()
      Description copied from interface: Item
      Helper 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.
    • baseUri

      public List<Item> baseUri()
      XDM 3.1 Section 6.3 Attribute Node Accessors — base-uri. For an Attribute Node, dm:base-uri returns the base URI of the parent element or document node, if it has one; otherwise it returns the empty sequence.
    • documentUri

      public List<Item> documentUri()
      XDM 3.1 Section 6.3 Attribute Node Accessors — document-uri. For an Attribute Node, dm:document-uri returns the document-uri of the document node that is the root of the tree containing the attribute, if it has one; otherwise it returns the empty sequence.
    • nilled

      public List<Item> nilled()
      XDM 3.1 Section 6.3 Attribute Node Accessors — nilled. For an Attribute Node, dm:nilled returns the empty sequence.
    • typeName

      public List<Item> typeName()
      XDM 3.1 Section 6.3 Attribute Node Accessors — type-name. For an Attribute Node, dm:type-name returns the name of the dynamic type of the attribute node, or the empty sequence if the node is untyped.
    • setSchemaType

      public void setSchemaType(@NonNull @NonNull XmlSchemaTypeAnnotation typeAnnotation, List<Item> typedValue)
      Description copied from interface: Item
      Sets a node's schema type annotation together with its XDM typed value.
      Parameters:
      typeAnnotation - the schema type annotation
      typedValue - the typed value, including an empty list for a valid empty typed value
    • clearSchemaType

      public void clearSchemaType()
      Description copied from interface: Item
      Removes a node's schema annotation and restores its untyped typed-value behavior.
    • getSchemaTypeAnnotation

      public XmlSchemaTypeAnnotation getSchemaTypeAnnotation()
      Returns:
      this node's XML Schema annotation, or null when the node is untyped.
    • setXmlSchemaIdentityProperties

      public void setXmlSchemaIdentityProperties(boolean id, boolean idRefs)
      Description copied from interface: Item
      Records the ID and IDREF properties supplied by XML Schema validation.