com.novell.xsl.parser
Class ParserVariables

java.lang.Object
  extended bycom.novell.xsl.parser.ParserVariables
All Implemented Interfaces:
VariableBindings

public class ParserVariables
extends Object
implements VariableBindings

Class that manages variables during stylesheet compilation.


Constructor Summary
ParserVariables()
           
 
Method Summary
 void bindTemplateVariable(ExpandedQName name, Expression variable)
          Bind an XSLT template variable by name.
 void bindTopLevelVariable(ExpandedQName name, Expression variable)
          Bind an XSLT top-level variable by name.
 Collection getTemplateVariables()
          Return a Collection of any currently bound template variables.
 Collection getTopLevelVariables()
          Return a Collection of any bound top-level variables.
 Expression getVariable(ExpandedQName varName)
          Return an object of type Expression given an ExpandedQName name.
 boolean haveTemplateVariable(ExpandedQName name)
          Return true if the passed name is bound to a template variable.
 void popTemplateVariables()
          Pop the collection of template variables pushed by pushTemplateVariables().
 void pushTemplateVariables()
          Push the collection of template (local) variables currently in scope in preparation for parsing a sub-template.
 void resetTemplateVariables()
          Clear any current template variables in preparation for parsing a new template
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParserVariables

public ParserVariables()
Method Detail

getVariable

public Expression getVariable(ExpandedQName varName)
Return an object of type Expression given an ExpandedQName name. Note that this will always return non-null because if a name is not bound, it is assumed to be a top-level variable whose definition has not yet been encountered. The parser will fixup the top level variable placeholders after the last node in the stylesheet tree is encountered.

Specified by:
getVariable in interface VariableBindings
Parameters:
varName - The name of the variable
Returns:
Expression object bound to passed name.

bindTopLevelVariable

public void bindTopLevelVariable(ExpandedQName name,
                                 Expression variable)
Bind an XSLT top-level variable by name.

Parameters:
name - The name of the variable.
variable - The variable expression

bindTemplateVariable

public void bindTemplateVariable(ExpandedQName name,
                                 Expression variable)
Bind an XSLT template variable by name.

Parameters:
name - The name of the variable
variable - The variable expression

haveTemplateVariable

public boolean haveTemplateVariable(ExpandedQName name)
Return true if the passed name is bound to a template variable.

Parameters:
name - The name to check.
Returns:
true if passed name is bound to a template variable.

resetTemplateVariables

public void resetTemplateVariables()
Clear any current template variables in preparation for parsing a new template


pushTemplateVariables

public void pushTemplateVariables()
Push the collection of template (local) variables currently in scope in preparation for parsing a sub-template.


popTemplateVariables

public void popTemplateVariables()
Pop the collection of template variables pushed by pushTemplateVariables().


getTemplateVariables

public Collection getTemplateVariables()
Return a Collection of any currently bound template variables. This may return null if there are no template variables currently bound.

Returns:
a Collection of any currently bound template variables or null.

getTopLevelVariables

public Collection getTopLevelVariables()
Return a Collection of any bound top-level variables. This may return null if no top-level variables are currently bound.

Returns:
a Collection of any currently bound top-level variables or null.