Package org.custommonkey.xmlunit
Class QualifiedName
- java.lang.Object
-
- org.custommonkey.xmlunit.QualifiedName
-
public final class QualifiedName extends Object
Since javax.xml.namespace.QName is not present prior to Java5, this is XMLUnit's own abstraction.
-
-
Constructor Summary
Constructors Constructor Description QualifiedName(String localName)QualifiedName without namespace URI.QualifiedName(String namespaceUri, String localName)QualifiedName with potential namespace URI.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)StringgetLocalName()StringgetNamespaceURI()inthashCode()StringtoString()Represents the QualifiedName as {NS-URI}LOCAL-NAME.static QualifiedNamevalueOf(String value)Parses strings of the form "{NS-URI}LOCAL-NAME" or "prefix:localName" as QualifiedNames.static QualifiedNamevalueOf(String value, NamespaceContext ctx)Parses strings of the form "{NS-URI}LOCAL-NAME" or "prefix:localName" as QualifiedNames.
-
-
-
Constructor Detail
-
QualifiedName
public QualifiedName(String localName)
QualifiedName without namespace URI.- Parameters:
localName- local name
-
-
Method Detail
-
getNamespaceURI
public String getNamespaceURI()
- Returns:
- namespace URI
-
getLocalName
public String getLocalName()
- Returns:
- local name
-
valueOf
public static QualifiedName valueOf(String value)
Parses strings of the form "{NS-URI}LOCAL-NAME" or "prefix:localName" as QualifiedNames.When using the prefix-version the prefix must be defined inside the current NamespaceContext.
- Parameters:
value- string to parse- Returns:
- parsed QualifiedName
- See Also:
XMLUnit.setXpathNamespaceContext(org.custommonkey.xmlunit.NamespaceContext)
-
toString
public String toString()
Represents the QualifiedName as {NS-URI}LOCAL-NAME.If the NS-URI is equal to NULL_NS_URI only the local name is returned.
-
valueOf
public static QualifiedName valueOf(String value, NamespaceContext ctx)
Parses strings of the form "{NS-URI}LOCAL-NAME" or "prefix:localName" as QualifiedNames.When using the prefix-version the prefix must be defined inside the NamespaceContext given as argument.
- Parameters:
value- string to parsectx- namespace context which must not be null when the prefix form is used- Returns:
- parsed QualifiedName
-
-