net.sf.saxon.value
Class QualifiedNameValue

java.lang.Object
  extended by net.sf.saxon.value.Value
      extended by net.sf.saxon.value.AtomicValue
          extended by net.sf.saxon.value.QualifiedNameValue
All Implemented Interfaces:
Serializable, Comparable, SequenceIterable, Item, ValueRepresentation
Direct Known Subclasses:
NotationValue, QNameValue

public abstract class QualifiedNameValue
extends AtomicValue

A qualified name: this is an abstract superclass for QNameValue and NotationValue, representing the XPath primitive types xs:QName and xs:NOTATION respectively

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Constructor Summary
QualifiedNameValue()
           
 
Method Summary
 int allocateNameCode(NamePool pool)
          Allocate a nameCode for this QName in the NamePool
 Object convertToJava(Class target, XPathContext context)
          Convert to Java object (for passing to external functions)
 String getClarkName()
          Get the name in Clark notation, that is {uri}local
 String getLocalName()
          Get the local part
 String getNamespaceURI()
          Get the namespace part (null means no namespace)
 String getPrefix()
          Get the prefix
 String getStringValue()
          Get the string value as a String.
 int hashCode()
          Return a hash code to support the equals() function
 Object makeQName(Configuration config)
          Temporary method to construct a javax.xml.namespace.QName without actually mentioning it by name (because the class is not available in JDK 1.4)
static AtomicValue makeQName(String prefix, String uri, String local, AtomicType targetType, CharSequence lexicalForm, TypeHierarchy th)
          Factory method to construct either a QName or a NOTATION value, or a subtype of either of these.
 String toString()
          The toString() method returns the name in the form QName("uri", "local")
 
Methods inherited from class net.sf.saxon.value.AtomicValue
checkPermittedContents, convert, convert, convertPrimitive, copy, effectiveBooleanValue, getCardinality, getComponent, getItemType, getLength, getPrimitiveType, getStringValueCS, getTypedValue, getTypeLabel, getXPathComparable, hasBuiltInType, isMultiValued, itemAt, iterate, process, setTypeLabel
 
Methods inherited from class net.sf.saxon.value.Value
asItem, asItem, asIterator, asValue, compareTo, convert, convertJavaObjectToXPath, equals, fromItem, getCanonicalLexicalRepresentation, getIterator, getSchemaComparable, iterate, makeQNameValue, reduce, stringToNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QualifiedNameValue

public QualifiedNameValue()
Method Detail

makeQName

public static AtomicValue makeQName(String prefix,
                                    String uri,
                                    String local,
                                    AtomicType targetType,
                                    CharSequence lexicalForm,
                                    TypeHierarchy th)
                             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-namespace
local - the local part of the value
targetType - the target type, which must be xs:QName or a subtype of xs:NOTATION or xs:QName
lexicalForm - the original lexical form of the value. This is needed in case there are facets such as pattern that check the lexical form
th - the type hierarchy cache
Returns:
the converted value
Throws:
XPathException - if the value cannot be converted.

getStringValue

public String getStringValue()
Get the string value as a String. Returns the QName as a lexical QName, retaining the original prefix if available.

Specified by:
getStringValue in interface Item
Specified by:
getStringValue in interface ValueRepresentation
Specified by:
getStringValue in class AtomicValue
Returns:
the string value of the item
See Also:
Item.getStringValueCS()

getClarkName

public String getClarkName()
Get the name in Clark notation, that is {uri}local


getLocalName

public String getLocalName()
Get the local part


getNamespaceURI

public String getNamespaceURI()
Get the namespace part (null means no namespace)


getPrefix

public String getPrefix()
Get the prefix


allocateNameCode

public int allocateNameCode(NamePool pool)
Allocate a nameCode for this QName in the NamePool

Parameters:
pool - the NamePool to be used
Returns:
the allocated nameCode

hashCode

public int hashCode()
Description copied from class: Value
Return a hash code to support the equals() function

Overrides:
hashCode in class Value

convertToJava

public Object convertToJava(Class target,
                            XPathContext context)
                     throws XPathException
Convert to Java object (for passing to external functions)

Overrides:
convertToJava in class Value
Throws:
XPathException

toString

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

Overrides:
toString in class AtomicValue
Returns:
the name in in the form QName("uri", "local")

makeQName

public Object makeQName(Configuration config)
Temporary method to construct a javax.xml.namespace.QName without actually mentioning it by name (because the class is not available in JDK 1.4)



Copyright (C) Michael H. Kay. All rights reserved.