net.sourceforge.templat.parser.context
Class TemplateParserContext
java.lang.Object
net.sourceforge.templat.parser.context.TemplateParserContext
public class TemplateParserContext
- extends Object
Represents a context of variables. Basically, a context is simply
a mapping of variable names to values.
- Author:
- Chris Mosher
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TemplateParserContext
public TemplateParserContext()
addVariable
public void addVariable(String varName,
Object varValue)
- Parameters:
varName
- varValue
-
isDefined
public boolean isDefined(String varName)
- Checks to see if the given variable is defined in
this context.
- Parameters:
varName
- name of variable to check
- Returns:
true
if the given variable is defined
getValue
public Object getValue(String varName)
throws TemplateParsingException
- Gets the value of a given variable in this context.
- Parameters:
varName
- name of variable to get
- Returns:
- the value of the given variable
- Throws:
TemplateParsingException
- if varName
is not defined in this context