public class QNameValue extends AtomicValue
EMPTY_CLASS_ARRAYEMPTY_VALUE_ARRAYEVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD| Constructor and Description |
|---|
QNameValue(NamePool namePool,
int nameCode)
Constructor
|
QNameValue(String prefix,
String uri,
String localName,
NameChecker checker)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
allocateNameCode(NamePool pool)
Allocate a nameCode for this QName in the NamePool
|
static AtomicValue |
castToQName(StringValue operand,
AtomicType targetType,
StaticContext env)
Create a QName value (possibly a DerivedAtomicValue derived from QName) from
a string literal, given a namespace context
|
AtomicValue |
convertPrimitive(BuiltInAtomicType requiredType,
boolean validate,
XPathContext context)
Convert to target data type
|
Object |
convertToJava(Class target,
XPathContext context)
Convert to Java object (for passing to external functions)
|
boolean |
equals(Object other)
Determine if two QName values are equal.
|
String |
getClarkName()
Get the name in Clark notation, that is {uri}local
|
AtomicValue |
getComponent(int part)
Get a component.
|
ItemType |
getItemType(TypeHierarchy th)
Return the type of the expression
|
String |
getLocalName()
Get the local part
|
String |
getNamespaceURI()
Get the namespace part (null means no namespace)
|
String |
getPrefix()
Get the prefix
|
String |
getStringValue()
Get the string value as a String.
|
int |
hashCode()
Return a hash code to support the equals() function
|
Object |
makeQName(Configuration config)
Temporary method to construct a javax.xml.namespace.QName without actually mentioning it
by name (because the class is not available in JDK 1.4)
|
String |
toString()
The toString() method returns the name in the form QName("uri", "local")
|
checkPermittedContents, convert, convert, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getImplementationMethod, getLength, getPrimitiveValue, getStringValueCS, getTypedValue, hasBuiltInType, iterate, process, schemaEqualsasItem, asIterator, asValue, collapseWhitespace, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, normalizeWhitespace, optimize, promote, reduce, simplify, stringToNumber, trimWhitespace, typeCheckpublic QNameValue(NamePool namePool, int nameCode)
namePool - The name pool containing the specified name codenameCode - The name code identifying this name in the name poolpublic QNameValue(String prefix, String uri, String localName, NameChecker checker) throws XPathException
prefix - The prefix part of the QName (not used in comparisons). Use null or "" to represent the
default prefix.uri - The namespace part of the QName. Use null or "" to represent the null namespace.localName - The local part of the QNamechecker - NameChecker used to check the name against XML 1.0 or XML 1.1 rules. Supply null
if the name does not need to be checked (the caller asserts that it is known to be valid)XPathExceptionpublic static AtomicValue castToQName(StringValue operand, AtomicType targetType, StaticContext env) throws XPathException
operand - the input stringtargetType - the type required: QName, or a type derived from QName or NOTATIONenv - the static context, including the namespace contextXPathException - if the name is lexically invalid or uses an undeclared prefixpublic String getStringValue()
getStringValue in interface ItemgetStringValue in interface ValueRepresentationgetStringValue in class AtomicValueItem.getStringValueCS()public String getClarkName()
public String getLocalName()
public String getNamespaceURI()
public String getPrefix()
public int allocateNameCode(NamePool pool)
pool - the NamePool to be usedpublic AtomicValue getComponent(int part)
getComponent in class AtomicValuepart - either Component.LOCALNAME or Component.NAMESPACE indicating which
component of the value is requiredpublic AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
convertPrimitive in class AtomicValuerequiredType - an integer identifying the required atomic typecontext - validate - true if validation is required. If set to false, the caller guarantees that
the value is valid for the target data type, and that further validation is therefore not required.
Note that a validation failure may be reported even if validation was not requested.public ItemType getItemType(TypeHierarchy th)
getItemType in interface ExpressiongetItemType in class Valueth - public boolean equals(Object other)
equals in class ValueClassCastException - if they are not comparableIllegalStateException - if the two QNames are in different name poolspublic int hashCode()
Valuepublic Object convertToJava(Class target, XPathContext context) throws XPathException
convertToJava in class ValueXPathExceptionpublic String toString()
toString in class AtomicValuepublic Object makeQName(Configuration config)