Class Element.Attribute

  • Enclosing class:
    Element

    public static class Element.Attribute
    extends java.lang.Object
    Class representing an XML attribute.
    • Constructor Summary

      Constructors 
      Constructor Description
      Attribute​(java.lang.String localName, java.lang.String value)  
      Attribute​(java.lang.String namespacePrefix, java.lang.String localName, java.lang.String value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      Element getElement()
      Returns the element to which this attribute belongs.
      java.lang.String getLocalName()  
      java.lang.String getName()
      Returns the fully-qualified name of the attribute.
      java.lang.String getNamespacePrefix()
      Returns the attribute's namespace prefix.
      java.lang.String getValue()  
      int hashCode()  
      void setValue​(java.lang.String value)
      Sets the attribute's value.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Attribute

        public Attribute​(java.lang.String localName,
                         java.lang.String value)
      • Attribute

        public Attribute​(java.lang.String namespacePrefix,
                         java.lang.String localName,
                         java.lang.String value)
    • Method Detail

      • getElement

        public Element getElement()
        Returns the element to which this attribute belongs.
        Returns:
        This attribute's element, or null if the attribute does not belong to an element.
      • getNamespacePrefix

        public java.lang.String getNamespacePrefix()
        Returns the attribute's namespace prefix.
        Returns:
        The attribute's namespace prefix, or null if the attribute belongs to the default namespace.
      • getLocalName

        public java.lang.String getLocalName()
        Returns:
        The attribute's local name.
      • getName

        public java.lang.String getName()
        Returns the fully-qualified name of the attribute.
        Returns:
        The local name if there is no namespace defined, or the fully-qualified name if there is a namespace.
      • getValue

        public java.lang.String getValue()
        Returns:
        The attribute's value.
      • setValue

        public void setValue​(java.lang.String value)
        Sets the attribute's value.
        Parameters:
        value - New value for this attribute.
        Throws:
        java.lang.IllegalArgumentException - if the value is null.
      • 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()
        Overrides:
        toString in class java.lang.Object