|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.value.Value | +--net.sf.saxon.value.AtomicValue | +--net.sf.saxon.value.DerivedAtomicValue
A DerivedAtomicValue is an atomic value of a user-defined type
Method Summary | |
int |
conversionPreference(java.lang.Class required,
Configuration config)
Get conversion preference for this value to a Java class. |
AtomicValue |
convert(int requiredType)
Convert the value to a given type. |
java.lang.Object |
convertToJava(java.lang.Class target,
Configuration config)
Convert to Java object (for passing to external functions) |
void |
display(int level,
NamePool pool)
Display the value as part of an expression tree display |
boolean |
effectiveBooleanValue(XPathContext context)
Get the effective boolean value of the value |
boolean |
equals(java.lang.Object obj)
Determine if this value is equal to another value |
Item |
evaluateItem(XPathContext context)
Evaluate the value (this simply returns the value unchanged) |
ItemType |
getItemType()
Get the item type of this atomic value |
AtomicValue |
getPrimitiveValue()
Get the primitive value (the value in the value space) |
java.lang.String |
getStringValue()
Evaluate as a string |
int |
hashCode()
Generate a hash code to support equality testing |
static DerivedAtomicValue |
makeValue(AtomicValue primValue,
java.lang.String lexicalValue,
AtomicType type,
boolean throwError)
Create a value of a user-defined atomic type |
java.lang.String |
toString()
Generate a string representation suitable for error messages |
Methods inherited from class net.sf.saxon.value.AtomicValue |
convert, evaluateAsString, getCardinality, getComponent, getTypedValue, iterate |
Methods inherited from class net.sf.saxon.value.Value |
analyze, asItem, asValue, collapseWhitespace, getDependencies, getSpecialProperties, getSubExpressions, inverse, normalizeWhitespace, promote, simplify, stringToNumber, trimWhitespace |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.saxon.om.Item |
getTypedValue |
Method Detail |
public static DerivedAtomicValue makeValue(AtomicValue primValue, java.lang.String lexicalValue, AtomicType type, boolean throwError) throws XPathException
primValue
- the value in the value space of the primitive typelexicalValue
- the value in the lexical space. If null, the string value of primValue
is used. This value is checked against the pattern facet (if any)type
- the required atomic typethrowError
- true if an exception is to be thrown when the value is
invalid (if false, the method returns null instead)
XPathException
- if the value is invalidpublic AtomicValue getPrimitiveValue()
getPrimitiveValue
in class AtomicValue
public AtomicValue convert(int requiredType) throws XPathException
convert
in class AtomicValue
requiredType
- type code of the required atomic type
XPathException
- if conversion is not allowed for this
required type, or if the particular value cannot be convertedpublic Item evaluateItem(XPathContext context) throws XPathException
evaluateItem
in interface Expression
evaluateItem
in class AtomicValue
context
- the evaluation context (not used in this implementation)
XPathException
public java.lang.String getStringValue() throws XPathException
getStringValue
in interface Item
getStringValue
in class Value
XPathException
- if the string value cannot be obtained. Some
items have no string value, e.g. a QNamepublic boolean effectiveBooleanValue(XPathContext context)
effectiveBooleanValue
in interface Expression
effectiveBooleanValue
in class AtomicValue
context
- the evaluation context (not used in this implementation)
public java.lang.Object convertToJava(java.lang.Class target, Configuration config) throws XPathException
AtomicValue
convertToJava
in class AtomicValue
target
- The class required by the external functionconfig
- The configuration (needed for access to schema information)
XPathException
public int conversionPreference(java.lang.Class required, Configuration config)
AtomicValue
conversionPreference
in class AtomicValue
public ItemType getItemType()
getItemType
in interface Expression
public void display(int level, NamePool pool)
display
in interface Expression
level
- indentation level of this subexpressionpool
- NamePool for resolving namespublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the other value to be compared
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |