|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.value.Value
A value is the result of an expression but it is also an expression in its own right. Note that every value can be regarded as a sequence - in many cases, a sequence of length one.
Constructor Summary | |
Value()
|
Method Summary | |
Expression |
analyze(StaticContext env)
TypeCheck an expression |
static Item |
asItem(Value value,
XPathContext context)
Static method to make an Item from a Value |
static Value |
asValue(Item item)
Static method to make a Value from a given Item (which may be either an AtomicValue or a NodeInfo |
static java.lang.CharSequence |
collapseWhitespace(java.lang.CharSequence in)
Collapse whitespace as defined in XML Schema |
abstract int |
conversionPreference(java.lang.Class required,
Configuration config)
Get conversion preference for this value to a Java class. |
abstract java.lang.Object |
convertToJava(java.lang.Class target,
Configuration config)
Convert the value to a Java object (for passing to external functions) |
int |
getDependencies()
Determine which aspects of the context the expression depends on. |
int |
getSpecialProperties()
Get the static properties of this expression (other than its type). |
abstract java.lang.String |
getStringValue()
Convert the value to a string, using the serialization rules. |
Expression[] |
getSubExpressions()
Get the sub-expressions of this expression. |
static int |
inverse(int operator)
Return the inverse of a relational operator, so that "a op b" can be rewritten as "b inverse(op) a" |
static java.lang.CharSequence |
normalizeWhitespace(java.lang.CharSequence in)
Normalize whitespace as defined in XML Schema |
Expression |
promote(PromotionOffer offer)
Offer promotion for this subexpression. |
Expression |
simplify()
Simplify an expression |
static double |
stringToNumber(java.lang.CharSequence s)
Static method to convert strings to numbers. |
static java.lang.CharSequence |
trimWhitespace(java.lang.CharSequence in)
Remove leading and trailing whitespace. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.sf.saxon.expr.Expression |
display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getItemType, iterate |
Constructor Detail |
public Value()
Method Detail |
public static Value asValue(Item item)
item
- The supplied item, or null, indicating the empty sequence.
public static Item asItem(Value value, XPathContext context) throws XPathException
value
- the value to be convertedcontext
- the context. It is probably safe to set this to null.
XPathException
- if the Value contains multiple itemspublic static double stringToNumber(java.lang.CharSequence s) throws java.lang.NumberFormatException
s
- the String to be converted
java.lang.NumberFormatException
- if the value cannot be convertedpublic static java.lang.CharSequence normalizeWhitespace(java.lang.CharSequence in)
public static java.lang.CharSequence collapseWhitespace(java.lang.CharSequence in)
public static java.lang.CharSequence trimWhitespace(java.lang.CharSequence in)
in
- the input string whose whitespace is to be removed
public final Expression simplify()
simplify
in interface Expression
public final Expression analyze(StaticContext env)
analyze
in interface Expression
env
- the static context of the expression
public final Expression[] getSubExpressions()
getSubExpressions
in interface Expression
public int getSpecialProperties()
getSpecialProperties
in interface Expression
public Expression promote(PromotionOffer offer)
promote
in interface Expression
offer
- details of the offer, for example the offer to move
expressions that don't depend on the context to an outer level in
the containing expression
public final int getDependencies()
getDependencies
in interface Expression
public static final int inverse(int operator)
public abstract java.lang.String getStringValue() throws XPathException
XPathException
public abstract java.lang.Object convertToJava(java.lang.Class target, Configuration config) throws XPathException
target
- The class required by the external functionconfig
- The configuration (needed for access to schema information)
XPathException
public abstract int conversionPreference(java.lang.Class required, Configuration config)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |