|
||||||||||
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.
Field Summary |
Fields inherited from interface net.sf.saxon.expr.Expression |
EVALUATE_METHOD, ITERATE_METHOD, PROCESS_METHOD |
Constructor Summary | |
Value()
|
Method Summary | |
Expression |
analyze(StaticContext env,
ItemType contextItemType)
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 |
static Value |
convertJavaObjectToXPath(java.lang.Object result,
Controller controller)
Convert a Java object to an XPath value. |
abstract java.lang.Object |
convertToJava(java.lang.Class target,
Configuration config,
XPathContext context)
Convert the value to a Java object (for passing to external functions) |
int |
getDependencies()
Determine which aspects of the context the expression depends on. |
Container |
getParentExpression()
Get the expression that immediately contains this expression. |
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. |
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" |
java.util.Iterator |
iterateSubExpressions()
Get the sub-expressions of this expression. |
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(StaticContext env)
Simplify an expression |
static double |
stringToNumber(java.lang.CharSequence s)
Static method to convert strings to numbers. |
java.lang.String |
toString()
Convert to a string for diagnostic output |
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, wait, wait, wait |
Methods inherited from interface net.sf.saxon.expr.Expression |
display, effectiveBooleanValue, evaluateAsString, evaluateItem, getCardinality, getImplementationMethod, getItemType, iterate, process |
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(StaticContext env)
simplify
in interface Expression
public final Expression analyze(StaticContext env, ItemType contextItemType)
analyze
in interface Expression
env
- the static context of the expressioncontextItemType
- the static type of "." at the point where this expression is invoked.
The parameter is set to null if it is known statically that the context item will be undefined.
If the type of the context item is not known statically, the argument is set to
Type.ITEM_TYPE
public final java.util.Iterator iterateSubExpressions()
iterateSubExpressions
in interface Expression
public Container getParentExpression()
getParentExpression
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, XPathContext context) throws XPathException
target
- The class required by the external functionconfig
- The configuration (needed for access to schema information)
XPathException
public static Value convertJavaObjectToXPath(java.lang.Object result, Controller controller) throws XPathException
result
- The Java object to be convertedcontroller
- The controller: may be null, in which case a Source object cannot be
supplied
XPathException
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 |