Package net.sf.saxon.value
Class QualifiedNameValue
- java.lang.Object
-
- net.sf.saxon.value.AtomicValue
-
- net.sf.saxon.value.QualifiedNameValue
-
- All Implemented Interfaces:
java.lang.Iterable<AtomicValue>
,AtomicMatchKey
,AtomicSequence
,GroundedValue
,IdentityComparable
,Item
,Sequence
,ConversionResult
- Direct Known Subclasses:
NotationValue
,QNameValue
public abstract class QualifiedNameValue extends AtomicValue implements AtomicMatchKey
A qualified name: this is an abstract superclass for QNameValue and NotationValue, representing the XPath primitive types xs:QName and xs:NOTATION respectively
-
-
Field Summary
Fields Modifier and Type Field Description protected StructuredQName
qName
-
Fields inherited from class net.sf.saxon.value.AtomicValue
typeLabel
-
-
Constructor Summary
Constructors Constructor Description QualifiedNameValue()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getClarkName()
Get the QName in Clark notation, that is "{uri}local" if in a namespace, or "local" otherwisejava.lang.String
getEQName()
Get the QName in EQName notation, that is "Q{uri}local" if in a namespace, or "Q{}local" otherwisejava.lang.String
getLocalName()
Get the local partjava.lang.String
getNamespaceURI()
Get the namespace part.java.lang.String
getPrefix()
Get the prefix.UnicodeString
getPrimitiveStringValue()
Get the string value as a String.StructuredQName
getStructuredQName()
Get the equivalent StructuredQNameAtomicMatchKey
getXPathMatchKey(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.int
identityHashCode()
Get a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode()boolean
isIdentical(AtomicValue v)
Determine whether two atomic values are identical, as determined by XML Schema rules.static AtomicValue
makeQName(java.lang.String prefix, java.lang.String uri, java.lang.String local, AtomicType targetType, UnicodeString lexicalForm, ConversionRules rules)
Factory method to construct either a QName or a NOTATION value, or a subtype of either of these.java.lang.String
show()
The show() method returns the name in the form QName("uri", "local")javax.xml.namespace.QName
toJaxpQName()
Construct a javax.xml.namespace.QName from this QualifiedNameValue-
Methods inherited from class net.sf.saxon.value.AtomicValue
asAtomic, asMapKey, atomize, checkPermittedContents, checkValidInJavascript, copyAsSubType, effectiveBooleanValue, equals, getCanonicalLexicalRepresentation, getCardinality, getComponent, getGenre, getItemType, getLength, getPrimitiveType, getUnicodeStringValue, getUType, getXPathComparable, head, isIdentical, isNaN, isUntypedAtomic, itemAt, iterate, iterator, setTypeLabel, toShortString, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.saxon.expr.sort.AtomicMatchKey
asAtomic
-
Methods inherited from interface net.sf.saxon.om.GroundedValue
asIterable, concatenate, containsNode, materialize
-
Methods inherited from interface net.sf.saxon.om.Item
getStringValue, isStreamed, reduce, subsequence
-
Methods inherited from interface net.sf.saxon.om.Sequence
makeRepeatable
-
-
-
-
Field Detail
-
qName
protected StructuredQName qName
-
-
Method Detail
-
makeQName
public static AtomicValue makeQName(java.lang.String prefix, java.lang.String uri, java.lang.String local, AtomicType targetType, UnicodeString lexicalForm, ConversionRules rules) throws XPathException
Factory method to construct either a QName or a NOTATION value, or a subtype of either of these. Note that it is the caller's responsibility to resolve the QName prefix into a URI- Parameters:
prefix
- the prefix part of the value. Use "" or null for the empty prefix.uri
- the namespace URI part of the value. Use "" or null for the non-namespacelocal
- the local part of the valuetargetType
- the target type, which must be xs:QName or a subtype of xs:NOTATION or xs:QNamelexicalForm
- the original lexical form of the value. This is needed in case there are facets such as pattern that check the lexical formrules
- the conversion rules to be applied- Returns:
- the converted value
- Throws:
XPathException
- if the value cannot be converted.
-
getPrimitiveStringValue
public final UnicodeString getPrimitiveStringValue()
Get the string value as a String. Returns the QName as a lexical QName, retaining the original prefix if available.- Specified by:
getPrimitiveStringValue
in classAtomicValue
- Returns:
- the value converted to a string
-
getClarkName
public final java.lang.String getClarkName()
Get the QName in Clark notation, that is "{uri}local" if in a namespace, or "local" otherwise- Returns:
- the name in Clark notation
-
getEQName
public final java.lang.String getEQName()
Get the QName in EQName notation, that is "Q{uri}local" if in a namespace, or "Q{}local" otherwise- Returns:
- the name in EQName notation
-
getLocalName
public final java.lang.String getLocalName()
Get the local part- Returns:
- the local part of the name (the part after the colon)
-
getNamespaceURI
public final java.lang.String getNamespaceURI()
Get the namespace part. Returns the empty string for a name in no namespace.- Returns:
- the namespace URI component of the name, or "" for a no-namespace name
-
getPrefix
public final java.lang.String getPrefix()
Get the prefix. Returns the empty string if the name is unprefixed.- Returns:
- the prefix, or "" to indicate no prefix
-
getXPathMatchKey
public AtomicMatchKey getXPathMatchKey(StringCollator collator, int implicitTimezone)
Get an object value that implements the XPath equality and ordering comparison semantics for this value. If the ordered parameter is set to true, the result will be a Comparable and will support a compareTo() method with the semantics of the XPath lt/gt operator, provided that the other operand is also obtained using the getXPathComparable() method. In all cases the result will support equals() and hashCode() methods that support the semantics of the XPath eq operator, again provided that the other operand is also obtained using the getXPathComparable() method. A context argument is supplied for use in cases where the comparison semantics are context-sensitive, for example where they depend on the implicit timezone or the default collation.- Specified by:
getXPathMatchKey
in classAtomicValue
- Parameters:
collator
- the collation to be used for the comparisonimplicitTimezone
- the XPath dynamic evaluation context, used in cases where the comparison is context- Returns:
- an Object whose equals() and hashCode() methods implement the XPath comparison semantics with respect to this atomic value. If ordered is specified, the result will either be null if no ordering is defined, or will be a Comparable
-
hashCode
public int hashCode()
Description copied from class:AtomicValue
Returns a hash code value for the object.- Overrides:
hashCode
in classAtomicValue
-
isIdentical
public boolean isIdentical(AtomicValue v)
Description copied from class:AtomicValue
Determine whether two atomic values are identical, as determined by XML Schema rules. This is a stronger test than equality (even schema-equality); for example two dateTime values are not identical unless they are in the same timezone.Note that even this check ignores the type annotation of the value. The integer 3 and the short 3 are considered identical, even though they are not fully interchangeable. "Identical" means the same point in the value space, regardless of type annotation.
NaN is identical to itself.
- Overrides:
isIdentical
in classAtomicValue
- Parameters:
v
- the other value to be compared with this one- Returns:
- true if the two values are identical, false otherwise.
-
identityHashCode
public int identityHashCode()
Get a hashCode that offers the guarantee that if A.isIdentical(B), then A.identityHashCode() == B.identityHashCode()- Specified by:
identityHashCode
in interfaceIdentityComparable
- Overrides:
identityHashCode
in classAtomicValue
- Returns:
- a hashCode suitable for use when testing for identity.
-
show
public java.lang.String show()
The show() method returns the name in the form QName("uri", "local")- Overrides:
show
in classAtomicValue
- Returns:
- the name in in the form QName("uri", "local")
-
toJaxpQName
public javax.xml.namespace.QName toJaxpQName()
Construct a javax.xml.namespace.QName from this QualifiedNameValue- Returns:
- an equivalent instance of the JAXP QName class
-
getStructuredQName
public StructuredQName getStructuredQName()
Get the equivalent StructuredQName- Returns:
- the equivalent StructuredQName
-
-