|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.templat.parser.context.ContextStack
public class ContextStack
A stack of TemplateParserContext
s. At any one given moment, a
ContextStack
can be used by the parser to determine the value
of a given variable. The contexts will be searched from inner-most (at the
top of the stack) to outer-most (at the bottom of the stack).
Constructor Summary | |
---|---|
ContextStack()
|
Method Summary | |
---|---|
boolean |
contains(String varName)
Checks if this stack contains the given variable. |
TemplateParserContext |
current()
Gets the current (inner-most) context (that is, the one at the top of this stack). |
Object |
getValue(String varName)
Gets the value of the given variable from this stack. |
boolean |
isEverEqual(String varName,
Object test)
Checks if the given variable is equal to the given value in any of this stack's contexts. |
void |
pop()
Pops the context off the top of this stack. |
void |
push(TemplateParserContext ctx)
Pushes the given context onto the top of this stack. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContextStack()
Method Detail |
---|
public void push(TemplateParserContext ctx)
ctx
- the context to pushpublic void pop()
public Object getValue(String varName) throws TemplateParsingException
varName
- variable to look up
TemplateParsingException
- if the variable is not foundpublic boolean contains(String varName)
varName
- the variable to search for
true
if any context in this stack contains the variable.public TemplateParserContext current()
public boolean isEverEqual(String varName, Object test) throws TemplateParsingException
varName
- the variable to search fortest
- value to check for the variable being equal to
true
if the variable is found, and contains the given value
TemplateParsingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |