|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.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 CharSequence |
collapseWhitespace(CharSequence in)
Collapse whitespace as defined in XML Schema |
abstract int |
conversionPreference(Class required)
Get conversion preference for this value to a Java class. |
abstract Object |
convertToJava(Class target)
Convert to 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). |
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 CharSequence |
normalizeWhitespace(CharSequence in)
Normalize whitespace as defined in XML Schema |
Expression |
promote(PromotionOffer offer)
Offer promotion for this subexpression. |
Expression |
simplify()
Simplify an expression |
static long |
stringToInteger(CharSequence s)
Static method to convert strings to integers. |
static double |
stringToNumber(CharSequence s)
Static method to convert strings to numbers. |
static CharSequence |
trimWhitespace(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(CharSequence s) throws NumberFormatException
s
- the String to be converted
NumberFormatException
- if the value cannot be convertedpublic static long stringToInteger(CharSequence s) throws XPathException
s
- the String to be converted
XPathException
public static CharSequence normalizeWhitespace(CharSequence in)
public static CharSequence collapseWhitespace(CharSequence in)
public static CharSequence trimWhitespace(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()
Expression
getSpecialProperties
in interface Expression
public Expression promote(PromotionOffer offer) throws XPathException
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
XPathException
- if any error is detectedpublic final int getDependencies()
getDependencies
in interface Expression
public static final int inverse(int operator)
public abstract Object convertToJava(Class target) throws XPathException
target
- The class required by the external function
XPathException
public abstract int conversionPreference(Class required)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |