jd.xml.xslt.template
Class Variable

java.lang.Object
  extended byjd.xml.xslt.template.Variable

public class Variable
extends Object

A Variable class.


Field Summary
static Variable[] EMPTY_LIST
           
static int PARAMETER
           
static int VARIABLE
           
static int WITHPARAM
           
 
Constructor Summary
Variable(VariableName name, Expression select, Template template, int type)
          Create a Variable.
 
Method Summary
 XObject getConstantValue()
          Return the constant value or null.
 Expression getExpression()
          Return the expression or null.
 Template getTemplate()
          Return the template or null.
 XObject getValue(XsltContext context)
          Return the variable value, evaluated for the given context.
static XObject[] getValues(XsltContext context, Variable[] variables)
          Evaluate an array of variables
 VariableName getVariableName()
          Return the variable name.
 boolean hasSameName(Variable variable)
          Test if the variable has the same name.
 boolean isParameter()
          Return true if the variable was defined by a xsl:param element or false if by a xsl:variable element.
 void setVariableName(Variable variable)
          Exchange the VariableName.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VARIABLE

public static final int VARIABLE
See Also:
Constant Field Values

PARAMETER

public static final int PARAMETER
See Also:
Constant Field Values

WITHPARAM

public static final int WITHPARAM
See Also:
Constant Field Values

EMPTY_LIST

public static final Variable[] EMPTY_LIST
Constructor Detail

Variable

public Variable(VariableName name,
                Expression select,
                Template template,
                int type)
Create a Variable.

Method Detail

isParameter

public boolean isParameter()
Return true if the variable was defined by a xsl:param element or false if by a xsl:variable element.


getVariableName

public VariableName getVariableName()
Return the variable name.


setVariableName

public void setVariableName(Variable variable)
Exchange the VariableName. This method is used for variable from a with-param instruction of a call-template instruction. After parsing when the called templates is known the with-param name (which has a index of -1) is discarded and changed to the name of the default parameter (which has the correct local variable index).


hasSameName

public boolean hasSameName(Variable variable)
Test if the variable has the same name.


getTemplate

public Template getTemplate()
Return the template or null.


getExpression

public Expression getExpression()
Return the expression or null.


getConstantValue

public XObject getConstantValue()
Return the constant value or null.


getValue

public XObject getValue(XsltContext context)
Return the variable value, evaluated for the given context.


toString

public String toString()

getValues

public static XObject[] getValues(XsltContext context,
                                  Variable[] variables)
Evaluate an array of variables

Parameters:
context - the context
variables - can be null
Returns:
the variable values or null if variables is null