|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.value.Value
net.sf.saxon.value.AtomicValue
net.sf.saxon.value.QNameValue
A QName value. This implements the so-called "triples proposal", in which the prefix is retained as part of the value. The prefix is not used in any operation on a QName other than conversion of the QName to a string.
Field Summary |
Fields inherited from class net.sf.saxon.value.Value |
EMPTY_CLASS_ARRAY |
Fields inherited from interface net.sf.saxon.om.ValueRepresentation |
EMPTY_VALUE_ARRAY |
Fields inherited from interface net.sf.saxon.expr.Expression |
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
QNameValue(NamePool namePool,
int nameCode)
Constructor |
|
QNameValue(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName,
NameChecker checker)
Constructor. |
Method Summary | |
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 |
java.lang.Object |
convertToJava(java.lang.Class target,
XPathContext context)
Convert to Java object (for passing to external functions) |
boolean |
equals(java.lang.Object other)
Determine if two QName values are equal. |
java.lang.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 |
java.lang.String |
getLocalName()
Get the local part |
java.lang.String |
getNamespaceURI()
Get the namespace part (null means no namespace) |
java.lang.String |
getPrefix()
Get the prefix |
java.lang.String |
getStringValue()
Get the string value as a String. |
int |
hashCode()
Return a hash code to support the equals() function |
java.lang.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) |
java.lang.String |
toString()
The toString() method returns the name in the form QName("uri", "local") |
Methods inherited from class net.sf.saxon.value.AtomicValue |
checkPermittedContents, convert, convert, display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getImplementationMethod, getLength, getPrimitiveValue, getStringValueCS, getTypedValue, hasBuiltInType, iterate, process, schemaEquals |
Methods inherited from class net.sf.saxon.value.Value |
asItem, asIterator, asValue, collapseWhitespace, convert, convertJavaObjectToXPath, getDependencies, getIterator, getParentExpression, getSpecialProperties, itemAt, iterateSubExpressions, makeQNameValue, normalizeWhitespace, optimize, promote, reduce, simplify, stringToNumber, trimWhitespace, typeCheck |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public 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(java.lang.String prefix, java.lang.String uri, java.lang.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)Method Detail |
public 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 context
XPathException
- if the name is lexically invalid or uses an undeclared prefixpublic java.lang.String getStringValue()
getStringValue
in interface Item
getStringValue
in class AtomicValue
public java.lang.String getClarkName()
public java.lang.String getLocalName()
public java.lang.String getNamespaceURI()
public java.lang.String getPrefix()
public int allocateNameCode(NamePool pool)
pool
- the NamePool to be used
public AtomicValue getComponent(int part)
getComponent
in class AtomicValue
part
- either Component.LOCALNAME or Component.NAMESPACE indicating which
component of the value is required
public AtomicValue convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
convertPrimitive
in class AtomicValue
requiredType
- 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 Expression
getItemType
in class Value
th
-
public boolean equals(java.lang.Object other)
equals
in class Value
java.lang.ClassCastException
- if they are not comparable
java.lang.IllegalStateException
- if the two QNames are in different name poolspublic int hashCode()
Value
hashCode
in class Value
public java.lang.Object convertToJava(java.lang.Class target, XPathContext context) throws XPathException
convertToJava
in class Value
XPathException
public java.lang.String toString()
toString
in class AtomicValue
public java.lang.Object makeQName(Configuration config)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |