public class QNameValue extends QualifiedNameValue
qName
typeLabel
Constructor and Description |
---|
QNameValue(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName)
Constructor for a QName that is known to be valid.
|
QNameValue(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName,
AtomicType type)
Constructor for a QName that is known to be valid, allowing a user-defined subtype of QName
to be specified.
|
QNameValue(java.lang.String prefix,
java.lang.String uri,
java.lang.String localName,
AtomicType type,
boolean check)
Constructor.
|
QNameValue(StructuredQName qName,
AtomicType typeLabel)
Constructor
|
Modifier and Type | Method and Description |
---|---|
AtomicValue |
copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type label
|
boolean |
equals(java.lang.Object other)
Determine if two QName values are equal.
|
AtomicValue |
getComponent(AccessorFn.Component part)
Get a component.
|
BuiltInAtomicType |
getPrimitiveType()
Determine the primitive type of the value.
|
XPathComparable |
getXPathComparable(StringCollator collator,
int implicitTimezone)
Get an object value that implements the XPath equality and ordering comparison semantics for this value.
|
int |
hashCode()
Returns a hash code value for the object.
|
getClarkName, getEQName, getLocalName, getNamespaceURI, getPrefix, getPrimitiveStringValue, getStructuredQName, getXPathMatchKey, identityHashCode, isIdentical, makeQName, show, toJaxpQName
asAtomic, asMapKey, atomize, checkPermittedContents, checkValidInJavascript, effectiveBooleanValue, getCanonicalLexicalRepresentation, getCardinality, getGenre, getItemType, getLength, getUnicodeStringValue, getUType, head, isIdentical, isNaN, isUntypedAtomic, itemAt, iterate, iterator, setTypeLabel, toShortString, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
asAtomic
getStringValue, isStreamed, reduce, subsequence
asIterable, concatenate, containsNode, materialize
makeRepeatable
public QNameValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName)
prefix
- The prefix part of the QName (not used in comparisons). Use "" to represent the
default prefix.uri
- The namespace part of the QName. Use "" to represent the non-namespace.localName
- The local part of the QNamepublic QNameValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName, AtomicType type)
prefix
- The prefix part of the QName (not used in comparisons). Use "" to represent the
default prefix (but null is also accepted)uri
- The namespace part of the QName. Use null to represent the non-namespace (but "" is also
accepted).localName
- The local part of the QNametype
- The type label, xs:QName or a subtype of xs:QNamepublic QNameValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName, AtomicType type, boolean check) throws XPathException
prefix
- The prefix part of the QName (not used in comparisons). Use "" to represent the
default prefix (but null is also accepted).
Note that the prefix is not checked for lexical correctness, because in most cases
it will already have been matched against in-scope namespaces. Where necessary the caller must
check the prefix.uri
- The namespace part of the QName. Use null to represent the non-namespace (but "" is also
accepted).localName
- The local part of the QNametype
- The atomic type, which must be either xs:QName, or a
user-defined type derived from xs:QName by restrictioncheck
- Supply false if the name does not need to be checked (the caller asserts that it is known to be valid)XPathException
- if the local part of the name is malformed or if the name has a null
namespace with a non-empty prefixpublic QNameValue(StructuredQName qName, AtomicType typeLabel)
qName
- the name as a StructuredQNametypeLabel
- idenfies a subtype of xs:QNamepublic AtomicValue copyAsSubType(AtomicType typeLabel)
copyAsSubType
in class AtomicValue
typeLabel
- the type label of the new copy. The caller is responsible for checking that
the value actually conforms to this type.public BuiltInAtomicType getPrimitiveType()
getPrimitiveType
in class AtomicValue
public AtomicValue getComponent(AccessorFn.Component part)
getComponent
in class AtomicValue
part
- either Component.LOCALNAME or Component.NAMESPACE indicating which
component of the value is requiredpublic boolean equals(java.lang.Object other)
equals
in class AtomicValue
other
- the other valuejava.lang.ClassCastException
- if they are not comparablepublic int hashCode()
AtomicValue
hashCode
in class QualifiedNameValue
public XPathComparable getXPathComparable(StringCollator collator, int implicitTimezone) throws NoDynamicContextException
AtomicValue
getXPathComparable
in class AtomicValue
collator
- the collation to be used when comparing stringsimplicitTimezone
- the implicit timezone in the dynamic context, used when comparing
dates/times with and without timezoneNoDynamicContextException
- if the supplied implicit timezone is "NO_TIMEZONE" (meaning
unknown), and the implicit timezone is actually required because the value in question is a date/time
value with no timezone. This can cause a failure to evaluate expressions statically (because the implicit
timezone is not known statically), and it will then be caught, meaning that the expression has to be
evaluated dynamically.Copyright (c) 2004-2022 Saxonica Limited. All rights reserved.