Package net.sf.saxon.value
Class NotationValue
- java.lang.Object
-
- net.sf.saxon.value.AtomicValue
-
- net.sf.saxon.value.QualifiedNameValue
-
- net.sf.saxon.value.NotationValue
-
- All Implemented Interfaces:
java.lang.Iterable<AtomicValue>
,AtomicMatchKey
,AtomicSequence
,GroundedValue
,IdentityComparable
,Item
,Sequence
,ConversionResult
public final class NotationValue extends QualifiedNameValue
An xs:NOTATION value.
-
-
Field Summary
-
Fields inherited from class net.sf.saxon.value.QualifiedNameValue
qName
-
Fields inherited from class net.sf.saxon.value.AtomicValue
typeLabel
-
-
Constructor Summary
Constructors Constructor Description NotationValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName)
Constructor for a value that is known to be validNotationValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName, boolean check)
ConstructorNotationValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName, AtomicType typeLabel)
Constructor for a value that is known to be validNotationValue(StructuredQName qName, AtomicType typeLabel)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AtomicValue
copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type labelboolean
equals(java.lang.Object other)
Determine if two Notation values are equal.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.java.lang.String
show()
The show() method returns the name in the formNOTATION({uri}local)
-
Methods inherited from class net.sf.saxon.value.QualifiedNameValue
getClarkName, getEQName, getLocalName, getNamespaceURI, getPrefix, getPrimitiveStringValue, getStructuredQName, getXPathMatchKey, identityHashCode, isIdentical, makeQName, toJaxpQName
-
Methods inherited from class net.sf.saxon.value.AtomicValue
asAtomic, asMapKey, atomize, checkPermittedContents, checkValidInJavascript, effectiveBooleanValue, getCanonicalLexicalRepresentation, getCardinality, getComponent, getGenre, getItemType, getLength, getUnicodeStringValue, getUType, 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
-
-
-
-
Constructor Detail
-
NotationValue
public NotationValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName, boolean check) throws XPathException
Constructor- Parameters:
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 QNamecheck
- Used for request checking names against XML 1.0 or XML 1.1 syntax rules- Throws:
XPathException
- if an error is detected
-
NotationValue
public NotationValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName)
Constructor for a value that is known to be valid- Parameters:
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 QName
-
NotationValue
public NotationValue(java.lang.String prefix, java.lang.String uri, java.lang.String localName, AtomicType typeLabel)
Constructor for a value that is known to be valid- Parameters:
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 QNametypeLabel
- A type derived from xs:NOTATION to be used for the new value
-
NotationValue
public NotationValue(StructuredQName qName, AtomicType typeLabel)
Constructor- Parameters:
qName
- the name as a StructuredQNametypeLabel
- idenfies a subtype of xs:QName
-
-
Method Detail
-
copyAsSubType
public AtomicValue copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type label- Specified by:
copyAsSubType
in classAtomicValue
- Parameters:
typeLabel
- the type label of the new copy. The caller is responsible for checking that the value actually conforms to this type.- Returns:
- the copied value
-
getPrimitiveType
public BuiltInAtomicType getPrimitiveType()
Determine the primitive type of the value. This delivers the same answer as getItemType().getPrimitiveItemType(). The primitive types are the 19 primitive types of XML Schema, plus xs:integer, xs:dayTimeDuration and xs:yearMonthDuration, and xs:untypedAtomic. For external objects, the result is AnyAtomicType.- Specified by:
getPrimitiveType
in classAtomicValue
- Returns:
- the primitive type
-
equals
public boolean equals(java.lang.Object other)
Determine if two Notation values are equal. This comparison ignores the prefix part of the value.- Overrides:
equals
in classAtomicValue
- Parameters:
other
- the other value- Returns:
- true (in a subclass) if the other operand is an atomic value and the two values are equal as defined by the XPath eq operator
- Throws:
java.lang.ClassCastException
- if they are not comparablejava.lang.IllegalStateException
- if the two QNames are in different name pools
-
hashCode
public int hashCode()
Description copied from class:AtomicValue
Returns a hash code value for the object.- Overrides:
hashCode
in classQualifiedNameValue
-
getXPathComparable
public XPathComparable getXPathComparable(StringCollator collator, int implicitTimezone) throws NoDynamicContextException
Description copied from class:AtomicValue
Get an object value that implements the XPath equality and ordering comparison semantics for this value. A collation is supplied for comparing strings, and an implicit timezone for comparing date/time values that have no saved timezone. An atomic value may return itself as the result, provided that its ordering rules are independent of the collation and timezone, and provided that it implements the XPathComparable interface: which means that its compareTo, equals, and hashCode methods must be compatible with the rules for XPath value comparisons.- Specified by:
getXPathComparable
in classAtomicValue
- Parameters:
collator
- the collation to be used when comparing stringsimplicitTimezone
- the implicit timezone in the dynamic context, used when comparing dates/times with and without timezone- Returns:
- an Object that implements the XPath value comparison semantics with respect to this atomic value. For an atomic type that is not ordered (according to XPath rules), return null.
- Throws:
NoDynamicContextException
- 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.
-
show
public java.lang.String show()
The show() method returns the name in the formNOTATION({uri}local)
- Overrides:
show
in classQualifiedNameValue
- Returns:
- the name in Clark notation: {uri}local
-
-