Class TLcdXMLName

java.lang.Object
com.luciad.format.xml.TLcdXMLName

public final class TLcdXMLName extends Object
A qualified XML name, containing an XML namespace part and a local name.

Note: XML names are currently implemented using the flyweight design pattern: for each XML name (namespace/local name combination), only one instance can exist, thereby enabling fast object comparisons. There is no guarantee that is will remain so in the future. Therefore, the equals method should always be used for comparisons, not the direct object reference test (==).

No constructors are available for this class; names need to be constructed via the static getInstance method.

  • Method Details

    • getInstance

      public static TLcdXMLName getInstance(String aNamespaceURI, String aLocalName)
      Returns a TLcdXMLName instance containing the given namespace and local name.
      Parameters:
      aNamespaceURI - the namespace of the XML name instance to be returned.
      aLocalName - the local name of the XML name instance to be returned.
      Returns:
      a TLcdXMLName instance containing the given namespace and local name.
    • getInstance

      public static TLcdXMLName getInstance(QName aQName)
      Returns a TLcdXMLName instance based on the given QName.
      Parameters:
      aQName - the QName for which to return an equivalent TLcdXMLName, never null
      Returns:
      a TLcdXMLName instance containing the namespace and local name of the given QName.
    • getLocalName

      public String getLocalName()
      Returns the local part of this XML name.
      Returns:
      the local part of this XML name.
    • getNameSpaceURI

      public String getNameSpaceURI()
      Returns the namespace part of this XML name.
      Returns:
      the namespace part of this XML name.
    • asQName

      public QName asQName()
      Returns a QName instance corresponding to this TLcdXMLName. If this TLcdXMLName was originally created from a QName, the returned QName will preserve the prefix of the original one.
      Returns:
      a QName instance corresponding to this TLcdXMLName.
    • equals

      public boolean equals(Object obj)
      Returns true if and only if the namespace of the compared objects are equal, and the local names of both objects are equal.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object with which to compare.
      Returns:
      true if both objects describe the same XML name, false\ otherwise.
    • hashCode

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

      public String toString()
      Returns a String representation of this XML name (a space-separated concatenation of the namespace and local name).
      Overrides:
      toString in class Object
      Returns:
      a String representation of this XML name.