org.peaseplate.internal.model
Class DefaultBuildContext

java.lang.Object
  extended by org.peaseplate.internal.model.AbstractRenderContext
      extended by org.peaseplate.internal.model.DefaultBuildContext
All Implemented Interfaces:
BuildContext, RenderContext

public class DefaultBuildContext
extends AbstractRenderContext
implements BuildContext

An abstract implementation of the execution context

Author:
Manfred HANTSCHEL

Constructor Summary
  DefaultBuildContext(TemplateEngine engine, java.util.Locale locale, LineSeparator lineSeparator)
           
protected DefaultBuildContext(TemplateEngine engine, Template template, java.util.Locale locale, LineSeparator lineSeparator)
           
  DefaultBuildContext(Template template, java.util.Locale locale, LineSeparator lineSeparator)
           
 
Method Summary
 MacroReference getMacroReference(java.lang.String qualifiedName)
          Returns the macro reference with the specified name and the specified extension
 java.lang.String getMessage(java.lang.String key, java.lang.Object... values)
           
 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 class org.peaseplate.internal.model.AbstractRenderContext
getEngine, getLineSeparator, getLocale, getTemplate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.peaseplate.RenderContext
getEngine, getLineSeparator, getLocale, getTemplate
 

Constructor Detail

DefaultBuildContext

public DefaultBuildContext(TemplateEngine engine,
                           java.util.Locale locale,
                           LineSeparator lineSeparator)
                    throws TemplateException
Throws:
TemplateException

DefaultBuildContext

public DefaultBuildContext(Template template,
                           java.util.Locale locale,
                           LineSeparator lineSeparator)
                    throws TemplateException
Throws:
TemplateException

DefaultBuildContext

protected DefaultBuildContext(TemplateEngine engine,
                              Template template,
                              java.util.Locale locale,
                              LineSeparator lineSeparator)
                       throws TemplateException
Throws:
TemplateException
Method Detail

pushWorkingObject

public void pushWorkingObject(java.lang.Object object)
Description copied from interface: BuildContext
Pushes the working object to the stack

Specified by:
pushWorkingObject in interface BuildContext
Parameters:
object - the working object
See Also:
BuildContext.pushWorkingObject(java.lang.Object)

popWorkingObject

public java.lang.Object popWorkingObject()
                                  throws java.lang.IllegalStateException
Description copied from interface: BuildContext
Pops the working object from the stack

Specified by:
popWorkingObject in interface BuildContext
Returns:
the working object
Throws:
java.lang.IllegalStateException - if there is no working object on the stack
See Also:
BuildContext.popWorkingObject()

getWorkingObject

public java.lang.Object getWorkingObject()
                                  throws java.lang.IllegalStateException
Description copied from interface: BuildContext
Gets the top most working object from the stack without popping it

Specified by:
getWorkingObject in interface BuildContext
Returns:
the working object
Throws:
java.lang.IllegalStateException - if there is no working object on the stack
See Also:
BuildContext.getWorkingObject()

pushMessages

public void pushMessages(Messages messages)
Description copied from interface: BuildContext
Pushes the messages to the stack

Specified by:
pushMessages in interface BuildContext
Parameters:
messages - the messages
See Also:
BuildContext.pushMessages(org.peaseplate.Messages)

popMessages

public Messages popMessages()
                     throws java.lang.IllegalStateException
Description copied from interface: BuildContext
Pops the messages from the stack

Specified by:
popMessages in interface BuildContext
Returns:
the messages
Throws:
java.lang.IllegalStateException - if there is no messages object on the stack
See Also:
BuildContext.popMessages()

getMessages

public Messages getMessages()
                     throws java.lang.IllegalStateException
Description copied from interface: BuildContext
Returns the current messages object from the stack

Specified by:
getMessages in interface BuildContext
Returns:
the top most messages object
Throws:
java.lang.IllegalStateException - if there is no messages object on the stack
See Also:
BuildContext.getMessages()

getMessage

public java.lang.String getMessage(java.lang.String key,
                                   java.lang.Object... values)
Specified by:
getMessage in interface RenderContext
See Also:
RenderContext.getMessage(java.lang.String, java.lang.Object[])

getMacroReference

public MacroReference getMacroReference(java.lang.String qualifiedName)
Description copied from interface: BuildContext
Returns the macro reference with the specified name and the specified extension

Specified by:
getMacroReference in interface BuildContext
Parameters:
qualifiedName - the qualifiedName of the macro
Returns:
the macro reference or null if not found
See Also:
BuildContext.getMacroReference(java.lang.String)

getVariable

public java.lang.Object getVariable(java.lang.String name)
Description copied from interface: BuildContext
Returns the variable with the specified name or null if not set

Specified by:
getVariable in interface BuildContext
Parameters:
name - the name
Returns:
the variable or null if not set
See Also:
BuildContext.getVariable(java.lang.String)

setVariable

public void setVariable(java.lang.String name,
                        java.lang.Object value)
Description copied from interface: BuildContext
Sets the variable with the specified name

Specified by:
setVariable in interface BuildContext
Parameters:
name - the name of the variable
value - the value of the variable
See Also:
BuildContext.setVariable(java.lang.String, java.lang.Object)

releaseVariable

public void releaseVariable(java.lang.String name)
Description copied from interface: BuildContext
Releases the variable with the specified name

Specified by:
releaseVariable in interface BuildContext
Parameters:
name - the name of the variable
See Also:
BuildContext.releaseVariable(java.lang.String)


Copyright © 2008. All Rights Reserved.