net.sf.saxon.value
Class NotationValue

java.lang.Object
  extended by net.sf.saxon.value.Value<AtomicValue>
      extended by net.sf.saxon.value.AtomicValue
          extended by net.sf.saxon.value.QualifiedNameValue
              extended by net.sf.saxon.value.NotationValue
All Implemented Interfaces:
PullEvent, GroundedValue<AtomicValue>, Item<AtomicValue>, ValueRepresentation<AtomicValue>, 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
 
Fields inherited from class net.sf.saxon.value.Value
INDETERMINATE_ORDERING
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Constructor Summary
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
NotationValue(String prefix, String uri, String localName, NameChecker checker)
          Constructor
NotationValue(StructuredQName qName, AtomicType typeLabel)
          Constructor
 
Method Summary
 AtomicValue copyAsSubType(AtomicType typeLabel)
          Create a copy of this atomic value, with a different type label
 boolean equals(Object other)
          Determine if two Notation values are equal.
 BuiltInAtomicType getPrimitiveType()
          Determine the primitive type of the value.
 Comparable getSchemaComparable()
          Get a Comparable value that implements the XML Schema ordering comparison semantics for this value.
 String toString()
          The toString() method returns the name in the form QName("uri", "local")
 
Methods inherited from class net.sf.saxon.value.QualifiedNameValue
allocateNameCode, getClarkName, getLocalName, getNamespaceURI, getPrefix, getPrimitiveStringValue, getStructuredQName, getXPathComparable, hashCode, isIdentical, makeQName, toJaxpQName, toStructuredQName
 
Methods inherited from class net.sf.saxon.value.AtomicValue
asAtomic, checkPermittedContents, effectiveBooleanValue, getCardinality, getComponent, getItemType, getLength, getStringValue, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence
 
Methods inherited from class net.sf.saxon.value.Value
asItem, asItem, asIterator, asValue, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, getSequenceLength, reduce
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NotationValue

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

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

NotationValue

public NotationValue(StructuredQName qName,
                     AtomicType typeLabel)
Constructor

Parameters:
qName - the name as a StructuredQName
typeLabel - 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 class AtomicValue
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 class AtomicValue
Returns:
the primitive type

equals

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

Specified by:
equals in class AtomicValue
Parameters:
other - the other value
Returns:
true if the other operand is an atomic value and the two values are equal as defined by the XPath eq operator
Throws:
ClassCastException - if they are not comparable
IllegalStateException - if the two QNames are in different name pools

getSchemaComparable

public Comparable getSchemaComparable()
Description copied from class: AtomicValue
Get a Comparable value that implements the XML Schema ordering comparison semantics for this value. An implementation must be provided for all atomic types.

In the case of data types that are partially ordered, the returned Comparable extends the standard semantics of the compareTo() method by returning the value Value.INDETERMINATE_ORDERING when there is no defined order relationship between two given values. This value is also returned when two values of different types are compared.

Specified by:
getSchemaComparable in class AtomicValue
Returns:
a Comparable that follows XML Schema comparison rules

toString

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

Overrides:
toString in class QualifiedNameValue
Returns:
the name in Clark notation: {uri}local


Copyright (c) 2004-2011 Saxonica Limited. All rights reserved.