net.sf.saxon.value

Class NotationValue

public final class NotationValue extends QualifiedNameValue

An xs:NOTATION value.
Constructor Summary
NotationValue(String prefix, String uri, String localName, NameChecker checker)
Constructor
NotationValue(String prefix, String uri, String localName)
Constructor for a value that is known to be valid
NotationValue(String prefix, String uri, String localName, AtomicType typeLabel)
Constructor for a value that is known to be valid
Method Summary
ConversionResultconvertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type
AtomicValuecopyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type label
booleanequals(Object other)
Determine if two Notation values are equal.
BuiltInAtomicTypegetPrimitiveType()
Determine the primitive type of the value.
ComparablegetSchemaComparable()
StringtoString()
The toString() method returns the name in the form QName("uri", "local")

Constructor Detail

NotationValue

public NotationValue(String prefix, String uri, String localName, NameChecker checker)
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 QName checker Used for checking names against XML 1.0 or XML 1.1 syntax rules

NotationValue

public NotationValue(String prefix, String uri, 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(String prefix, String uri, 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 QName typeLabel A type derived from xs:NOTATION to be used for the new value

Method Detail

convertPrimitive

public ConversionResult convertPrimitive(BuiltInAtomicType requiredType, boolean validate, XPathContext context)
Convert to target data type

Parameters: requiredType an integer identifying the required atomic type context The XPath dynamic context

Returns: an AtomicValue, a value of the required type; or an ErrorValue

copyAsSubType

public AtomicValue copyAsSubType(AtomicType typeLabel)
Create a copy of this atomic value, with a different type label

Parameters: typeLabel the type label of the new copy. The caller is responsible for checking that the value actually conforms to this type.

equals

public boolean equals(Object other)
Determine if two Notation values are equal. This comparison ignores the prefix part of the value.

Throws: ClassCastException if they are not comparable IllegalStateException if the two QNames are in different name pools

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.

getSchemaComparable

public Comparable getSchemaComparable()

toString

public String toString()
The toString() method returns the name in the form QName("uri", "local")

Returns: the name in Clark notation: {uri}local