Class XmlAttribute

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int SIZE
      The serialized size in bytes of an XmlAttribute.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static XmlAttribute create​(java.nio.ByteBuffer buffer, XmlNodeChunk parent)
      Creates a new XmlAttribute based on the bytes at the current buffer position.
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      java.lang.String name()
      The attribute name, or the empty string if not present.
      int nameIndex()
      A string reference to the attribute name.
      java.lang.String namespace()
      The namespace URI, or the empty string if not present.
      int namespaceIndex()
      A string reference to the namespace URI, or -1 if not present.
      XmlNodeChunk parent()
      The parent of this XML attribute; used for dereferencing the namespace and name.
      java.lang.String rawValue()
      The raw character value.
      int rawValueIndex()
      A string reference to a string containing the character value.
      byte[] toByteArray()
      Converts this resource into an array of bytes representation.
      byte[] toByteArray​(boolean shrink)
      Converts this resource into an array of bytes representation.
      java.lang.String toString()
      Returns a brief description of this XML attribute.
      BinaryResourceValue typedValue()
      A BinaryResourceValue instance containing the parsed value.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • create

        public static XmlAttribute create​(java.nio.ByteBuffer buffer,
                                          XmlNodeChunk parent)
        Creates a new XmlAttribute based on the bytes at the current buffer position.
        Parameters:
        buffer - A buffer whose position is at the start of a XmlAttribute.
        parent - The parent chunk that contains this attribute; used for string lookups.
      • namespaceIndex

        public int namespaceIndex()
        A string reference to the namespace URI, or -1 if not present.
      • nameIndex

        public int nameIndex()
        A string reference to the attribute name.
      • rawValueIndex

        public int rawValueIndex()
        A string reference to a string containing the character value.
      • parent

        public XmlNodeChunk parent()
        The parent of this XML attribute; used for dereferencing the namespace and name.
      • namespace

        public final java.lang.String namespace()
        The namespace URI, or the empty string if not present.
      • name

        public final java.lang.String name()
        The attribute name, or the empty string if not present.
      • rawValue

        public final java.lang.String rawValue()
        The raw character value.
      • toByteArray

        public byte[] toByteArray()
        Description copied from interface: SerializableResource
        Converts this resource into an array of bytes representation.
        Specified by:
        toByteArray in interface SerializableResource
        Returns:
        An array of bytes representing this resource.
      • toByteArray

        public byte[] toByteArray​(boolean shrink)
        Description copied from interface: SerializableResource
        Converts this resource into an array of bytes representation.
        Specified by:
        toByteArray in interface SerializableResource
        Parameters:
        shrink - True if, when converting to a byte array, this resource can modify the returned bytes in an effort to reduce the size.
        Returns:
        An array of bytes representing this resource.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Returns a brief description of this XML attribute. The representation of this information is subject to change, but below is a typical example:
        "XmlAttribute{namespace=foo, name=bar, value=1234}"
        Overrides:
        toString in class java.lang.Object