Class Attribute


  • @API(type=NOT_EXTENDABLE,
         src=PRIVATE)
    public class Attribute
    extends java.lang.Object
    An attribute representation used mainly in the content completion process.
    • Constructor Detail

      • Attribute

        public Attribute​(java.lang.String qName,
                         java.lang.String value,
                         java.lang.String namespace,
                         java.lang.String prefix)
        Creates an attribute with a specified qualified name, value, namespace and prefix.
        Parameters:
        qName - The attribute fully qualified name.
        value - The attribute value.
        namespace - The attribute namespace.
        prefix - The attribute prefix.
    • Method Detail

      • getQName

        public java.lang.String getQName()
        Gets the attribute fully qualified name.
        Returns:
        The attribute qualified name of the attribute.
      • getValue

        public java.lang.String getValue()
        Gets for the attribute value.
        Returns:
        The value. Not null.
      • getNamespace

        public java.lang.String getNamespace()
        Gets the attribute namespace.
        Returns:
        The attribute namespace.
      • getLocalName

        public java.lang.String getLocalName()
        Gets the attribute local name.
        Returns:
        The attribute local name.
      • toString

        public java.lang.String toString()
        Return the string representation of the attribute. It contains the attribute qualified name, the namespace and the attribute value.
        Overrides:
        toString in class java.lang.Object
      • getNameEndOffset

        public int getNameEndOffset()
        Returns:
        The end offset of the name.
      • getNameStartOffset

        public int getNameStartOffset()
        Returns:
        The start offset of the name.
      • getValueEndOffset

        public int getValueEndOffset()
        Returns:
        The end offset of the value.
      • getValueStartOffset

        public int getValueStartOffset()
        Returns:
        The start offset of the value.
      • isNamespaceDeclaration

        public boolean isNamespaceDeclaration()
        Returns:
        If true the attribute is namespace declaration.
      • getPrefix

        public java.lang.String getPrefix()
        Returns:
        Returns the attribute prefix.
      • setNamespace

        public void setNamespace​(java.lang.String namespace)
        Parameters:
        namespace - The attribute namespace to set.
      • setNameStartOffset

        public void setNameStartOffset​(int nameStartOffset)
        Parameters:
        nameStartOffset - The attribute name start offset to set.
      • setNameEndOffset

        public void setNameEndOffset​(int nameEndOffset)
        Parameters:
        nameEndOffset - The attribute name end offset to set.
      • setValueStartOffset

        public void setValueStartOffset​(int valueStartOffset)
        Parameters:
        valueStartOffset - The value start offset to set.
      • setValueEndOffset

        public void setValueEndOffset​(int valueEndOffset)
        Parameters:
        valueEndOffset - The value end offset to set.
      • isDefaultNamespaceDeclaration

        public boolean isDefaultNamespaceDeclaration()
        Returns:
        Returns the default namespace declaration.
      • hasValue

        public boolean hasValue()
        Check if the attribute has a value, or is empty attribute.
        Returns:
        true if it has a value, false for empty attributes.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
        See Also:
        Object.equals(java.lang.Object)