Class AttributeWithValue

java.lang.Object
com.deltaxml.dita.config.AttributeWithValue

public class AttributeWithValue extends Object
Represents an XML Attribute name and value pair.
  • Constructor Details

    • AttributeWithValue

      public AttributeWithValue(String namespaceURI, String prefix, String localName, String value) throws IllegalArgumentException
      Constructs a new attribute with a name that is in a namespace.
      Parameters:
      namespaceURI - the namespace in which the name is held.
      prefix - the prefix to map the namespaceURI to.
      localName - the name of the attribute.
      value - the String value of the attribute.
      Throws:
      IllegalArgumentException - if 1) a namespaceURI is defined and an empty (or null) prefix is defined or 2) a prefix is defined and an empty (or null) namespaceURI is defined or 3) a valid QName object cannot be created from the namespaceURI, prefix and localName.
    • AttributeWithValue

      public AttributeWithValue(String localName, String value) throws IllegalArgumentException
      Constructs a new attribute with a name that is not in a namespace.
      Parameters:
      localName - the name of the attribute.
      value - the String value of the attribute.
      Throws:
      IllegalArgumentException - if a valid QName object cannot be created from the localName.
  • Method Details

    • getNamespaceURI

      public String getNamespaceURI()
      Return the attribute's namespaceURI.
      Returns:
      a String representation of the namespaceURI.
    • getPrefix

      public String getPrefix()
      Return the attribute's prefix.
      Returns:
      a String representation of the prefix.
    • getLocalName

      public String getLocalName()
      Return the attribute's localName.
      Returns:
      a String representation of the localName.
    • getClarkName

      public String getClarkName()
      Return the attribute's Clark Name. This is the name in the form {uri}localName.
      Returns:
      a String representation of the Clark Name.
    • getValue

      public String getValue()
      Return the value of the attribute.
      Returns:
      the String value.
    • toString

      public String toString()
      Returns an encoded String representing the attribute. This encoded form is for internal use.
      Overrides:
      toString in class Object
      Returns:
      a String representation of the Attribute
    • equals

      public boolean equals(Object obj)
      Determines equality with another Object. Used to ensure that Sets do not contain the same value twice.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare.
      Returns:
      true if the object to compare is an AttributeWithValue with the same qualified name (QName).
    • hashCode

      public int hashCode()
      The hashCode. This is the hashCode of the underpinning qualified name (QName).
      Overrides:
      hashCode in class Object
      Returns:
      the hashCode.