|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xml.utils.QName
Class to represent a qualified name: "The name of an internal XSLT object, specifically a named template (see [7 Named Templates]), a mode (see [6.7 Modes]), an attribute set (see [8.1.4 Named Attribute Sets]), a key (see [14.2 Keys]), a locale (see [14.3 Number Formatting]), a variable or a parameter (see [12 Variables and Parameters]) is specified as a QName. If it has a prefix, then the prefix is expanded into a URI reference using the namespace declarations in effect on the attribute in which the name occurs. The expanded name consisting of the local part of the name and the possibly null URI reference is used as the name of the object. The default namespace is not used for unprefixed names."
Field Summary | |
static java.lang.String |
S_XMLNAMESPACEURI
The XML namespace. |
Constructor Summary | |
QName()
Constructs an empty QName. |
|
QName(java.lang.String localName)
Construct a QName from a string, without namespace resolution. |
|
QName(java.lang.String localName,
boolean validate)
Construct a QName from a string, without namespace resolution. |
|
QName(java.lang.String qname,
Element namespaceContext,
PrefixResolver resolver)
Construct a QName from a string, resolving the prefix using the given namespace context and prefix resolver. |
|
QName(java.lang.String qname,
Element namespaceContext,
PrefixResolver resolver,
boolean validate)
Construct a QName from a string, resolving the prefix using the given namespace context and prefix resolver. |
|
QName(java.lang.String qname,
PrefixResolver resolver)
Construct a QName from a string, resolving the prefix using the given namespace stack. |
|
QName(java.lang.String qname,
PrefixResolver resolver,
boolean validate)
Construct a QName from a string, resolving the prefix using the given namespace stack. |
|
QName(java.lang.String qname,
java.util.Stack namespaces)
Construct a QName from a string, resolving the prefix using the given namespace stack. |
|
QName(java.lang.String qname,
java.util.Stack namespaces,
boolean validate)
Construct a QName from a string, resolving the prefix using the given namespace stack. |
|
QName(java.lang.String namespaceURI,
java.lang.String localName)
Constructs a new QName with the specified namespace URI and local name. |
|
QName(java.lang.String namespaceURI,
java.lang.String localName,
boolean validate)
Constructs a new QName with the specified namespace URI and local name. |
|
QName(java.lang.String namespaceURI,
java.lang.String prefix,
java.lang.String localName)
Constructs a new QName with the specified namespace URI, prefix and local name. |
|
QName(java.lang.String namespaceURI,
java.lang.String prefix,
java.lang.String localName,
boolean validate)
Constructs a new QName with the specified namespace URI, prefix and local name. |
Method Summary | |
boolean |
equals(java.lang.Object object)
Override equals and agree that we're equal if the passed object is a QName and it matches the name of the arg. |
boolean |
equals(java.lang.String ns,
java.lang.String localPart)
Override equals and agree that we're equal if the passed object is a string and it matches the name of the arg. |
java.lang.String |
getLocalName()
Returns the local part of the qualified name. |
java.lang.String |
getLocalPart()
Get the local part of the qualified name. |
static java.lang.String |
getLocalPart(java.lang.String qname)
Returns the local name of the given node. |
java.lang.String |
getNamespace()
Get the namespace of the qualified name. |
java.lang.String |
getNamespaceURI()
Returns the namespace URI. |
java.lang.String |
getPrefix()
Returns the namespace prefix. |
static java.lang.String |
getPrefixFromXMLNSDecl(java.lang.String attRawName)
This function tells if a raw attribute name is a xmlns attribute. |
static java.lang.String |
getPrefixPart(java.lang.String qname)
Returns the local name of the given node. |
static QName |
getQNameFromString(java.lang.String name)
Given a string, create and return a QName object |
int |
hashCode()
Return the cached hashcode of the qualified name. |
static boolean |
isXMLNSDecl(java.lang.String attRawName)
This function tells if a raw attribute name is a xmlns attribute. |
java.lang.String |
toNamespacedString()
Return the string representation of the qualified name using the the '{ns}foo' notation. |
java.lang.String |
toString()
Return the string representation of the qualified name, using the prefix if available, or the '{ns}foo' notation if not. |
Methods inherited from class java.lang.Object |
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String S_XMLNAMESPACEURI
Constructor Detail |
public QName()
public QName(java.lang.String namespaceURI, java.lang.String localName)
namespaceURI
- The namespace URI if known, or nulllocalName
- The local namepublic QName(java.lang.String namespaceURI, java.lang.String localName, boolean validate)
namespaceURI
- The namespace URI if known, or nulllocalName
- The local namevalidate
- If true the new QName will be validated and an IllegalArgumentException will
be thrown if it is invalid.public QName(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName)
namespaceURI
- The namespace URI if known, or nullprefix
- The namespace prefix is known, or nulllocalName
- The local namepublic QName(java.lang.String namespaceURI, java.lang.String prefix, java.lang.String localName, boolean validate)
namespaceURI
- The namespace URI if known, or nullprefix
- The namespace prefix is known, or nulllocalName
- The local namevalidate
- If true the new QName will be validated and an IllegalArgumentException will
be thrown if it is invalid.public QName(java.lang.String localName)
localName
- Local part of qualified namepublic QName(java.lang.String localName, boolean validate)
localName
- Local part of qualified namevalidate
- If true the new QName will be validated and an IllegalArgumentException will
be thrown if it is invalid.public QName(java.lang.String qname, java.util.Stack namespaces)
qname
- Qualified name to resolvenamespaces
- Namespace stack to use to resolve namespacepublic QName(java.lang.String qname, java.util.Stack namespaces, boolean validate)
qname
- Qualified name to resolvenamespaces
- Namespace stack to use to resolve namespacevalidate
- If true the new QName will be validated and an IllegalArgumentException will
be thrown if it is invalid.public QName(java.lang.String qname, Element namespaceContext, PrefixResolver resolver)
qname
- Qualified name to resolvenamespaceContext
- Namespace Context to useresolver
- Prefix resolver for this contextpublic QName(java.lang.String qname, Element namespaceContext, PrefixResolver resolver, boolean validate)
qname
- Qualified name to resolvenamespaceContext
- Namespace Context to useresolver
- Prefix resolver for this contextvalidate
- If true the new QName will be validated and an IllegalArgumentException will
be thrown if it is invalid.public QName(java.lang.String qname, PrefixResolver resolver)
qname
- Qualified name to resolveresolver
- Prefix resolver for this contextpublic QName(java.lang.String qname, PrefixResolver resolver, boolean validate)
qname
- Qualified name to resolveresolver
- Prefix resolver for this contextvalidate
- If true the new QName will be validated and an IllegalArgumentException will
be thrown if it is invalid.Method Detail |
public java.lang.String getNamespaceURI()
public java.lang.String getPrefix()
public java.lang.String getLocalName()
public java.lang.String toString()
public java.lang.String toNamespacedString()
public java.lang.String getNamespace()
public java.lang.String getLocalPart()
public int hashCode()
public boolean equals(java.lang.String ns, java.lang.String localPart)
ns
- Namespace URI to compare tolocalPart
- Local part of qualified name to compare topublic boolean equals(java.lang.Object object)
qname
- Qualified name to compare topublic static QName getQNameFromString(java.lang.String name)
name
- String to use to create QNamepublic static boolean isXMLNSDecl(java.lang.String attRawName)
attRawName
- Raw name of attributepublic static java.lang.String getPrefixFromXMLNSDecl(java.lang.String attRawName)
attRawName
- Raw name of attributepublic static java.lang.String getLocalPart(java.lang.String qname)
qname
- Input namepublic static java.lang.String getPrefixPart(java.lang.String qname)
qname
- Input name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |