com.icl.saxon.expr
Class  VariableReference
java.lang.Object
  |
  +--com.icl.saxon.expr.Expression
        |
        +--com.icl.saxon.expr.VariableReference
- public class VariableReference- extends Expression
Variable reference: a reference to an XSL variable
 
 
| Method Summary | 
|  Value | evaluate(Context c)Get the value of this variable in a given context.
 | 
|  Binding | getBinding()Get the object bound to the variable
 | 
|  int | getDataType()Determine the data type of the expression, if possible
 | 
|  int | getDependencies()Determine which aspects of the context the expression depends on.
 | 
|  Expression | reduce(int dependencies,
       Context context)Perform a partial evaluation of the expression, by eliminating specified dependencies
 on the context.
 | 
|  Expression | simplify()Simplify the expression.
 | 
|  java.lang.String | toString()Get a string representing the variable reference, for diagnostics
 | 
 
| Methods inherited from class com.icl.saxon.expr.Expression | 
| containsReferences, enumerate, evaluateAsBoolean, evaluateAsNodeSet, evaluateAsNumber, evaluateAsString, getStaticContext, isNumeric, isRelative, make, make, setStaticContext, usesCurrent | 
 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
 
VariableReference
public VariableReference(Name name,
                         StaticContext staticContext)
                  throws org.xml.sax.SAXException
- Constructor- 
- Parameters:
- name- the variable name (as a Name object)
 
getDependencies
public int getDependencies()
- Determine which aspects of the context the expression depends on. The result is
 a bitwise-or'ed value composed from constants such as Context.VARIABLES and
 Context.CURRENT_NODE- 
- Overrides:
- getDependenciesin class- Expression
 
reduce
public Expression reduce(int dependencies,
                         Context context)
                  throws org.xml.sax.SAXException
- Perform a partial evaluation of the expression, by eliminating specified dependencies
 on the context.- 
- Overrides:
- reducein class- Expression
 
- 
- Parameters:
- dependencies- The dependencies to be removed
- context- The context to be used for the partial evaluation
- Returns:
- a new expression that does not have any of the specified
 dependencies
 
evaluate
public Value evaluate(Context c)
               throws org.xml.sax.SAXException
- Get the value of this variable in a given context.- 
- Overrides:
- evaluatein class- Expression
 
- 
- Parameters:
- context- the Context which contains the relevant variable bindings
- Returns:
- the value of the variable, if it is defined
 
getBinding
public Binding getBinding()
- Get the object bound to the variable
toString
public java.lang.String toString()
- Get a string representing the variable reference, for diagnostics- 
- Overrides:
- toStringin class- java.lang.Object
 
getDataType
public int getDataType()
- Determine the data type of the expression, if possible- 
- Overrides:
- getDataTypein class- Expression
 
- 
- Returns:
- the type of the variable, if this can be determined statically;
 otherwise Value.ANY (meaning not known in advance)
 
simplify
public Expression simplify()
- Simplify the expression. If the variable has a fixed value, the variable reference
 will be replaced with that value.- 
- Overrides:
- simplifyin class- Expression
 
- Following copied from class: com.icl.saxon.expr.Expression
- 
- Returns:
- the simplified expression