Package com.tangosol.run.xml
Class QualifiedName
- java.lang.Object
-
- com.tangosol.run.xml.QualifiedName
-
public class QualifiedName extends Object
AQualifiedName
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 ofString
s 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
Constructors Constructor Description QualifiedName(QualifiedName qualifiedName, String localName)
Standard Constructor (using a specifiedQualifiedName
for the prefix).QualifiedName(XmlElement xmlElement)
Standard Constructor.QualifiedName(String xmlName)
Standard Constructor.QualifiedName(String prefix, String localName)
Standard Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object other)
String
getLocalName()
Returns the local name of theQualifiedName
.String
getName()
Returns the entire qualified name, including the prefix and local name.String
getPrefix()
Returns the xml prefix of theQualifiedName
.int
hashCode()
boolean
hasPrefix()
Returns boolean based on if theQualifiedName
has a namespace prefix.String
toString()
-
-
-
Constructor Detail
-
QualifiedName
public QualifiedName(String xmlName) throws UnknownFormatConversionException
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
public QualifiedName(XmlElement xmlElement) throws UnknownFormatConversionException
Standard Constructor.- Parameters:
xmlElement
- AnXmlElement
from which to return theQualifiedName
- Throws:
UnknownFormatConversionException
- When the specified xmlElement is invalid (contains mulitple :'s)
-
QualifiedName
public QualifiedName(QualifiedName qualifiedName, String localName)
Standard Constructor (using a specifiedQualifiedName
for the prefix).- Parameters:
qualifiedName
- TheQualifiedName
on which to base the newQualifiedName
.localName
- The local name for the newQualifiedName
.
-
QualifiedName
public QualifiedName(String prefix, String localName)
Standard Constructor.- Parameters:
prefix
- The xmlns prefix for theQualifiedName
localName
- The localname for theQualifiedName
-
-
Method Detail
-
getPrefix
public String getPrefix()
Returns the xml prefix of theQualifiedName
.- Returns:
- Returns "" if the name is not qualified with a namespace prefix
-
getLocalName
public String getLocalName()
Returns the local name of theQualifiedName
.- Returns:
- Returns the local part of a qualified name.
-
getName
public String 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 theQualifiedName
has a namespace prefix.- Returns:
true
If theQualifiedName
has an xmlns prefix
-
-