|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.xsl.process.TemplateCollection com.novell.xsl.process.VariableTemplate
A template that instantiates an XSLT variable NOTE: this template implements the functionality of both xsl:variable and xsl:param. The reason for this is so that the top-level xsl:variable and xsl:param can share functionality (top-level vars and params have a little different behavior)
TopLevelVariableTemplate
Field Summary | |
protected ExpressionValue |
currentValue
Current value of the variable during execution of the stylesheet |
Constructor Summary | |
VariableTemplate(ExpandedQName name,
Expression select,
Template[] templates,
boolean isParam,
Node nsContext)
Constructs a VariableTemplate that create binds a value to a
variable |
|
VariableTemplate(ExpandedQName name,
Expression select,
Template[] templates,
Node nsContext)
Constructs a VariableTemplate that create binds a value to a
variable |
Method Summary | |
void |
dump(PrintWriter out,
int indent)
Dumps this object to the specified output stream. |
ExpressionValue |
evaluate(Node contextNode,
ExpressionContext context)
Evaluate the expression with repect to the passed context Note: The contextNode and context parameters may be null if and only if isConstant() returns true for the expression implementation. |
ExpressionValue |
getCurrentValue()
Return the current variable value. |
ExpandedQName |
getName()
Return the name of this variable. |
Class |
getResultType()
Return the Class object describing the result type of the expression. |
Expression |
getSelect()
Return the select expression (if any) of this variable. |
void |
instantiate(ProcessingEnv env,
Node currentNode,
ResultHandler result)
Instantiates this template for the specified current node and sends the result to the specified result handler. |
boolean |
isConstant()
Return true if the expression is a constant value. |
boolean |
isParam()
Return true if this object represents an xsl:param element. |
void |
registerForReset(XPathResetRegistrar registrar)
Register this expression or any subexpression that implements XPathResetCache with an object that wants to call resetCache() |
void |
setCurrentValue(ExpressionValue value)
Set the current variable value. |
Methods inherited from class com.novell.xsl.process.TemplateCollection |
getNamespaceContext, getTemplates, instantiateTemplates |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected ExpressionValue currentValue
Constructor Detail |
public VariableTemplate(ExpandedQName name, Expression select, Template[] templates, Node nsContext)
VariableTemplate
that create binds a value to a
variable
name
- the name of the variable (a expanded name)select
- the optional expression that is evaluated to give the
the value of the variabletemplates
- the templates to be evaluated to get the variable's value
if no select expression is givennsContext
- The node in the style sheet from which this template comespublic VariableTemplate(ExpandedQName name, Expression select, Template[] templates, boolean isParam, Node nsContext)
VariableTemplate
that create binds a value to a
variable
name
- the name of the variable (an expanded name)select
- the optional expression that is evaluated to give the
the value of the variabletemplates
- the templates to be evaluated to get the variable's value
if no select expression is givenisParam
- true if this represents an xsl:param elementnsContext
- The node in the style sheet from which this template comesMethod Detail |
public ExpandedQName getName()
public Expression getSelect()
public boolean isParam()
public ExpressionValue getCurrentValue()
null
if not yet evaluatedpublic void setCurrentValue(ExpressionValue value)
value
- The variable value to setpublic void instantiate(ProcessingEnv env, Node currentNode, ResultHandler result) throws XSLException
For a VariableTemplate
, this method evaluates the select expression,
or instantiates the result fragment template, and places the variable within scope.
instantiate
in interface Template
env
- the current processing environmentcurrentNode
- the current source noderesult
- the handler to which results are sent
XSLException
- if a fatal error occurs during instantiationpublic void dump(PrintWriter out, int indent)
Template
and
Expression
dump
in interface Expression
dump
in class TemplateCollection
out
- the output stream to write toindent
- number of tabs to indentpublic ExpressionValue evaluate(Node contextNode, ExpressionContext context) throws XPathEvaluationException
evaluate
in interface Expression
contextNode
- context node for expression evaluationcontext
- expression context for expression evaluation
XPathEvaluationException
public boolean isConstant()
isConstant
in interface Expression
public Class getResultType()
getResultType
in interface Expression
public void registerForReset(XPathResetRegistrar registrar)
resetCache()
registerForReset
in interface Expression
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |