Package com.tangosol.run.xml
Class QualifiedName
java.lang.Object
com.tangosol.run.xml.QualifiedName
A
QualifiedName is a useful class to separately capture the xml namespace prefix
and local name of xml elements and attributes as a single object (instead of having to parse them
out of Strings all the time).
For example, the xmlName "movie:definition" has the namespace prefix "movie"
and the local name "definition". If there is no namespace prefix declared, the prefix is
always returned as "".- Author:
- bko 2011.06.22
-
Constructor Summary
ConstructorsConstructorDescriptionQualifiedName(QualifiedName qualifiedName, String localName) Standard Constructor (using a specifiedQualifiedNamefor the prefix).QualifiedName(XmlElement xmlElement) Standard Constructor.QualifiedName(String xmlName) Standard Constructor.QualifiedName(String prefix, String localName) Standard Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the local name of theQualifiedName.getName()Returns the entire qualified name, including the prefix and local name.Returns the xml prefix of theQualifiedName.inthashCode()booleanReturns boolean based on if theQualifiedNamehas a namespace prefix.toString()
-
Constructor Details
-
QualifiedName
Standard Constructor.- Parameters:
xmlName- The name of an xml element/attribute from which to create a qualified name. Must be of the format "prefix:name" or simply "name" (in which case the prefix is considered "")- Throws:
UnknownFormatConversionException- When the specified xmlName is invalid (contains mulitple :'s)
-
QualifiedName
Standard Constructor.- Parameters:
xmlElement- AnXmlElementfrom which to return theQualifiedName- Throws:
UnknownFormatConversionException- When the specified xmlElement is invalid (contains mulitple :'s)
-
QualifiedName
Standard Constructor (using a specifiedQualifiedNamefor the prefix).- Parameters:
qualifiedName- TheQualifiedNameon which to base the newQualifiedName.localName- The local name for the newQualifiedName.
-
QualifiedName
Standard Constructor.- Parameters:
prefix- The xmlns prefix for theQualifiedNamelocalName- The localname for theQualifiedName
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
getPrefix
Returns the xml prefix of theQualifiedName.- Returns:
- Returns "" if the name is not qualified with a namespace prefix
-
getLocalName
Returns the local name of theQualifiedName.- Returns:
- Returns the local part of a qualified name.
-
getName
Returns the entire qualified name, including the prefix and local name.- Returns:
- A string containing the entire qualified name, including prefix and local name.
-
hasPrefix
public boolean hasPrefix()Returns boolean based on if theQualifiedNamehas a namespace prefix.- Returns:
trueIf theQualifiedNamehas an xmlns prefix
-