Class Attribute


  • final class Attribute
    extends java.lang.Object
    Container for information collected regarding a single element attribute instance. Used for both regular explicit attributes and values added via attribute value defaulting.

    This class is not exposed outside of the package and is considered part of internal implementation.

    Since:
    4.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String mLocalName  
      protected java.lang.String mNamespaceURI  
      protected java.lang.String mPrefix  
      protected java.lang.String mReusableValue
      Value as a String iff it has been requested once; stored here in case it will be accessed again.
      protected int mValueStartOffset
      Numeric offset within text builder that denotes pointer to the first character of the value for this attribute (or namespace).
    • Constructor Summary

      Constructors 
      Constructor Description
      Attribute​(java.lang.String prefix, java.lang.String localName, int valueStart)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.xml.namespace.QName getQName()  
      java.lang.String getValue​(java.lang.String allValues)
      Method called if this attribute is the last one with value in the buffer.
      java.lang.String getValue​(java.lang.String allValues, int endOffset)  
      boolean hasLocalName​(java.lang.String localName)  
      protected boolean hasQName​(java.lang.String uri, java.lang.String localName)  
      void reset​(java.lang.String prefix, java.lang.String localName, int valueStart)  
      void setValue​(java.lang.String value)
      Method called to inject specific value for this attribute.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mLocalName

        protected java.lang.String mLocalName
      • mPrefix

        protected java.lang.String mPrefix
      • mNamespaceURI

        protected java.lang.String mNamespaceURI
      • mValueStartOffset

        protected int mValueStartOffset
        Numeric offset within text builder that denotes pointer to the first character of the value for this attribute (or namespace). End offset is derived by looking at start pointer of the following attribute; or total length for the last entry
      • mReusableValue

        protected java.lang.String mReusableValue
        Value as a String iff it has been requested once; stored here in case it will be accessed again.
    • Constructor Detail

      • Attribute

        public Attribute​(java.lang.String prefix,
                         java.lang.String localName,
                         int valueStart)
    • Method Detail

      • reset

        public void reset​(java.lang.String prefix,
                          java.lang.String localName,
                          int valueStart)
      • setValue

        public void setValue​(java.lang.String value)
        Method called to inject specific value for this attribute.
      • hasQName

        protected boolean hasQName​(java.lang.String uri,
                                   java.lang.String localName)
        Parameters:
        uri - Namespace URI of the attribute, if any; MUST be given as null if no namespace
        localName - Local name to match. Note: is NOT guaranteed to have been interned
        Returns:
        True if qualified name of this attribute is the same as what arguments describe
      • hasLocalName

        public boolean hasLocalName​(java.lang.String localName)
        Since:
        5.2
      • getQName

        public javax.xml.namespace.QName getQName()
      • getValue

        public java.lang.String getValue​(java.lang.String allValues)
        Method called if this attribute is the last one with value in the buffer. If so, end value is implied
      • getValue

        public java.lang.String getValue​(java.lang.String allValues,
                                         int endOffset)