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 String
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
ConstructorDescriptionQualifiedName
(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
Modifier and TypeMethodDescriptionboolean
Returns the local name of theQualifiedName
.getName()
Returns the entire qualified name, including the prefix and local name.Returns the xml prefix of theQualifiedName
.int
hashCode()
boolean
Returns boolean based on if theQualifiedName
has 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
- AnXmlElement
from which to return theQualifiedName
- Throws:
UnknownFormatConversionException
- When the specified xmlElement is invalid (contains mulitple :'s)
-
QualifiedName
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
Standard Constructor.- Parameters:
prefix
- The xmlns prefix for theQualifiedName
localName
- 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 theQualifiedName
has a namespace prefix.- Returns:
true
If theQualifiedName
has an xmlns prefix
-