terp - the Codemesh Modular
Template Interpreter v1.3.304

com.codemesh.terp.api
Interface TerpContext

All Superinterfaces:
java.lang.Cloneable
All Known Implementing Classes:
TerpContextImpl

public interface TerpContext
extends java.lang.Cloneable

The interface implemented by the concrete evaluation context.


Method Summary
 void appendForeachPrefix()
           
 void appendForeachSeparator()
           
 void appendForeachSuffix()
           
 void appendText(java.lang.String text)
           
 TerpContext clone()
          Returns a cloned context object.
 TerpContext createChained()
          Creates a context that shares the same variables but has a different appendable and an empty line.
 void done()
           
 void enterScope(TerpEvaluator eval, Node meta)
           
 java.lang.Appendable getAppendable()
          Returns the appendable target to which template expansions are appended.
 java.util.Map<java.lang.String,java.lang.Object> getBindings()
          Returns the input bindings.
 java.util.Map<java.lang.String,java.lang.Object> getExternalBindings()
          Returns the external properties.
 Lvalue getMetadataLvalue(java.lang.String id)
           
 Rvalue getMetadataRvalue(java.lang.String id)
           
 void leaveScope()
           
 java.lang.Object peek()
          Returns the topmost execution stack object.
 InternalContext peekContext()
          Returns the topmost scope stack context.
 InputSource peekSource()
           
 java.lang.Object pop()
          Pops an object from the execution stack.
 InternalContext popContext()
          Pops an internal scope context from the scope stack.
 InputSource popSource()
           
 void push(java.lang.Object obj)
          Pushes an object onto the execution stack.
 void pushContext(InternalContext ctx)
          Pushes a new internal scope context onto the scope stack.
 void pushSource(InputSource source)
           
 Lvalue resolveLvalue(TerpEvaluator eval, Rvalue rval, java.lang.String id)
           
 Lvalue resolveLvalue(TerpEvaluator eval, java.lang.String id)
           
 Rvalue resolveRvalue(TerpEvaluator eval, Rvalue rval, java.lang.String id)
           
 Rvalue resolveRvalue(TerpEvaluator eval, java.lang.String id)
          Attempts to resolve an rvalue absolutely (from the global level).
 java.lang.Object resolveSource(java.lang.Object source)
           
 void setAppendable(java.lang.Appendable app)
          Sets the Appendable into which template expansions are written.
 void setBindings(java.util.Map<java.lang.String,java.lang.Object> bindings)
          Sets the bindings that represent input variables.
 void setExternalBindings(java.util.Map<java.lang.String,java.lang.Object> bindings)
          Sets the bindings that are inherited from an external component.
 void setScopeVariable(java.lang.String id, java.lang.Object value)
           
 boolean suppressSevere()
           
 boolean suppressSevere(boolean bSuppress)
           
 

Method Detail

clone

TerpContext clone()
Returns a cloned context object.

Returns:
a context that contains duplicated stacks and bindings populated with the same stack elements.

createChained

TerpContext createChained()
Creates a context that shares the same variables but has a different appendable and an empty line.

Returns:
a related context.

setAppendable

void setAppendable(java.lang.Appendable app)
Sets the Appendable into which template expansions are written.

Parameters:
app - the appendable target for template expansions.

getAppendable

java.lang.Appendable getAppendable()
Returns the appendable target to which template expansions are appended.

Returns:
an appendable object.

setBindings

void setBindings(java.util.Map<java.lang.String,java.lang.Object> bindings)
Sets the bindings that represent input variables.

Parameters:
bindings - the input bindings.

getBindings

java.util.Map<java.lang.String,java.lang.Object> getBindings()
Returns the input bindings.

Returns:
the input bindings.

setExternalBindings

void setExternalBindings(java.util.Map<java.lang.String,java.lang.Object> bindings)
Sets the bindings that are inherited from an external component. These bindings are typically a properties set from a tool like ANT or Maven.

Parameters:
bindings - externally maintained bindings.

getExternalBindings

java.util.Map<java.lang.String,java.lang.Object> getExternalBindings()
Returns the external properties.

Returns:
the external bindings.

push

void push(java.lang.Object obj)
Pushes an object onto the execution stack.

Parameters:
obj - the object to push.

pop

java.lang.Object pop()
Pops an object from the execution stack.

Returns:
the popped object.

peek

java.lang.Object peek()
Returns the topmost execution stack object.

Returns:
the topmost execution stack object.

pushContext

void pushContext(InternalContext ctx)
Pushes a new internal scope context onto the scope stack. The scope stack maintains settings that are of limited scope, for example the metadata settings of block statements.

Parameters:
ctx - the internal context to push.

popContext

InternalContext popContext()
Pops an internal scope context from the scope stack.

Returns:
the pooped context.

peekContext

InternalContext peekContext()
Returns the topmost scope stack context.

Returns:
the topmost scope stack context.

pushSource

void pushSource(InputSource source)

popSource

InputSource popSource()

peekSource

InputSource peekSource()

resolveSource

java.lang.Object resolveSource(java.lang.Object source)

resolveRvalue

Rvalue resolveRvalue(TerpEvaluator eval,
                     Rvalue rval,
                     java.lang.String id)

resolveRvalue

Rvalue resolveRvalue(TerpEvaluator eval,
                     java.lang.String id)
Attempts to resolve an rvalue absolutely (from the global level).

Parameters:
eval - the evaluator.
id - the global identifier of the object.
Returns:
an rvalue returning the value of the object or null.

getMetadataRvalue

Rvalue getMetadataRvalue(java.lang.String id)

getMetadataLvalue

Lvalue getMetadataLvalue(java.lang.String id)

resolveLvalue

Lvalue resolveLvalue(TerpEvaluator eval,
                     Rvalue rval,
                     java.lang.String id)

resolveLvalue

Lvalue resolveLvalue(TerpEvaluator eval,
                     java.lang.String id)

enterScope

void enterScope(TerpEvaluator eval,
                Node meta)

leaveScope

void leaveScope()

setScopeVariable

void setScopeVariable(java.lang.String id,
                      java.lang.Object value)

appendText

void appendText(java.lang.String text)

done

void done()

appendForeachPrefix

void appendForeachPrefix()

appendForeachSeparator

void appendForeachSeparator()

appendForeachSuffix

void appendForeachSuffix()

suppressSevere

boolean suppressSevere(boolean bSuppress)

suppressSevere

boolean suppressSevere()

terp - the Codemesh Modular
Template Interpreter v1.3.304

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.