org.peaseplate.internal
Interface BuildContext

All Superinterfaces:
RenderContext
All Known Implementing Classes:
DefaultBuildContext

public interface BuildContext
extends RenderContext

The context for building a template from chunks.

Author:
Manfred HANTSCHEL

Method Summary
 MacroReference getMacroReference(java.lang.String qualifiedName)
          Returns the macro reference with the specified name and the specified extension
 Messages getMessages()
          Returns the current messages object from the stack
 java.lang.Object getVariable(java.lang.String name)
          Returns the variable with the specified name or null if not set
 java.lang.Object getWorkingObject()
          Gets the top most working object from the stack without popping it
 Messages popMessages()
          Pops the messages from the stack
 java.lang.Object popWorkingObject()
          Pops the working object from the stack
 void pushMessages(Messages messages)
          Pushes the messages to the stack
 void pushWorkingObject(java.lang.Object object)
          Pushes the working object to the stack
 void releaseVariable(java.lang.String name)
          Releases the variable with the specified name
 void setVariable(java.lang.String name, java.lang.Object value)
          Sets the variable with the specified name
 
Methods inherited from interface org.peaseplate.RenderContext
getEngine, getLineSeparator, getLocale, getMessage, getTemplate
 

Method Detail

pushWorkingObject

void pushWorkingObject(java.lang.Object object)
Pushes the working object to the stack

Parameters:
object - the working object

popWorkingObject

java.lang.Object popWorkingObject()
                                  throws java.lang.IllegalStateException
Pops the working object from the stack

Returns:
the working object
Throws:
java.lang.IllegalStateException - if there is no working object on the stack

getWorkingObject

java.lang.Object getWorkingObject()
                                  throws java.lang.IllegalStateException
Gets the top most working object from the stack without popping it

Returns:
the working object
Throws:
java.lang.IllegalStateException - if there is no working object on the stack

pushMessages

void pushMessages(Messages messages)
Pushes the messages to the stack

Parameters:
messages - the messages

popMessages

Messages popMessages()
                     throws java.lang.IllegalStateException
Pops the messages from the stack

Returns:
the messages
Throws:
java.lang.IllegalStateException - if there is no messages object on the stack

getMessages

Messages getMessages()
                     throws java.lang.IllegalStateException
Returns the current messages object from the stack

Returns:
the top most messages object
Throws:
java.lang.IllegalStateException - if there is no messages object on the stack

getMacroReference

MacroReference getMacroReference(java.lang.String qualifiedName)
Returns the macro reference with the specified name and the specified extension

Parameters:
qualifiedName - the qualifiedName of the macro
Returns:
the macro reference or null if not found

setVariable

void setVariable(java.lang.String name,
                 java.lang.Object value)
Sets the variable with the specified name

Parameters:
name - the name of the variable
value - the value of the variable

getVariable

java.lang.Object getVariable(java.lang.String name)
Returns the variable with the specified name or null if not set

Parameters:
name - the name
Returns:
the variable or null if not set

releaseVariable

void releaseVariable(java.lang.String name)
Releases the variable with the specified name

Parameters:
name - the name of the variable


Copyright © 2008. All Rights Reserved.