Package org.apache.tiles.core.impl
Class BasicTilesContainer
java.lang.Object
org.apache.tiles.core.impl.BasicTilesContainer
- All Implemented Interfaces:
- TilesContainer,- AttributeEvaluatorFactoryAware
public class BasicTilesContainer
extends Object
implements TilesContainer, AttributeEvaluatorFactoryAware
Basic implementation of the tiles container interface.
 In most cases, this container will be customized by
 injecting customized services, not necessarily by
 override the container
- Since:
- 2.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidendContext(Request request) Ends a context, where attribute values are stored independently of others.
 It must be called after aTilesContainer.startContext(Request)call.Evaluates the given attribute.Returns the Tiles application context used by this container.getAttributeContext(Request request) Retrieve the attribute context of the current request.protected AttributeContextgetContext(Request tilesContext) Get attribute context from request.protected Deque<AttributeContext>getContextStack(Request tilesContext) Returns the context stack.getDefinition(String definitionName, Request request) Returns a definition specifying its name.booleanisValidDefinition(String definitionName, Request request) Determine whether the definition exists.protected AttributeContextpopContext(Request tilesContext) Pops a context object out of the stack.voidExecutes a preparer.protected voidpushContext(AttributeContext context, Request tilesContext) Pushes a context object in the stack.voidRender the given tiles request.voidRender the given Attribute.voidrender(Definition definition, Request request) Renders the specified definition.protected voidrender(Request request, AttributeContext attributeContext) Renders the specified attribute context.voidrenderContext(Request request) Renders the current context, as it is.voidsetApplicationContext(ApplicationContext context) Sets the Tiles application context to use.voidsetAttributeEvaluatorFactory(AttributeEvaluatorFactory attributeEvaluatorFactory) Sets the attribute evaluator factory.voidsetDefinitionsFactory(DefinitionsFactory definitionsFactory) Set the definitions factory.voidsetPreparerFactory(PreparerFactory preparerFactory) Set the preparerInstance factory.voidsetRendererFactory(RendererFactory rendererFactory) Sets the renderer instance factory.startContext(Request request) Starts a new context, where attribute values are stored independently of others.
 When the use of the contexts is finished, callTilesContainer.endContext(Request)
- 
Constructor Details- 
BasicTilesContainerpublic BasicTilesContainer()
 
- 
- 
Method Details- 
startContextStarts a new context, where attribute values are stored independently of others.
 When the use of the contexts is finished, callTilesContainer.endContext(Request)- Specified by:
- startContextin interface- TilesContainer
- Parameters:
- request- The request.
- Returns:
- The newly created context.
 
- 
endContextEnds a context, where attribute values are stored independently of others.
 It must be called after aTilesContainer.startContext(Request)call.- Specified by:
- endContextin interface- TilesContainer
- Parameters:
- request- The request.
 
- 
renderContextRenders the current context, as it is.- Specified by:
- renderContextin interface- TilesContainer
- Parameters:
- request- The request.
 
- 
getApplicationContextReturns the Tiles application context used by this container.- Specified by:
- getApplicationContextin interface- TilesContainer
- Returns:
- the application context for this container.
 
- 
setApplicationContextSets the Tiles application context to use.- Parameters:
- context- The Tiles application context.
 
- 
getAttributeContextRetrieve the attribute context of the current request.- Specified by:
- getAttributeContextin interface- TilesContainer
- Parameters:
- request- The request.
- Returns:
- map of the attributes in the current attribute context.
 
- 
setDefinitionsFactorySet the definitions factory. This method first ensures that the container has not yet been initialized.- Parameters:
- definitionsFactory- the definitions factory for this instance.
 
- 
setPreparerFactorySet the preparerInstance factory. This method first ensures that the container has not yet been initialized.- Parameters:
- preparerFactory- the preparerInstance factory for this conainer.
 
- 
setRendererFactorySets the renderer instance factory.- Parameters:
- rendererFactory- the renderer instance factory for this container.
- Since:
- 2.1.0
 
- 
setAttributeEvaluatorFactorySets the attribute evaluator factory.- Specified by:
- setAttributeEvaluatorFactoryin interface- AttributeEvaluatorFactoryAware
- Parameters:
- attributeEvaluatorFactory- The attribute evaluator factory to use.
 
- 
prepareExecutes a preparer.- Specified by:
- preparein interface- TilesContainer
- Parameters:
- preparer- The name of the preparer to execute.
- request- The request.
 
- 
renderRender the given tiles request.- Specified by:
- renderin interface- TilesContainer
- Parameters:
- definitionName- the current definition.
- request- The request.
 
- 
renderRenders the specified definition.- Specified by:
- renderin interface- TilesContainer
- Parameters:
- definition- The definition to render.
- request- The request context.
- Since:
- 2.1.3
 
- 
renderRender the given Attribute.- Specified by:
- renderin interface- TilesContainer
- Parameters:
- attr- The attribute to render.
- request- The request.
- Throws:
- IOException- If something goes wrong during writing to the output.
 
- 
evaluateEvaluates the given attribute.- Specified by:
- evaluatein interface- TilesContainer
- Parameters:
- attribute- The attribute to evaluate.
- request- The request.
- Returns:
- The evaluated object.
 
- 
isValidDefinitionDetermine whether the definition exists.- Specified by:
- isValidDefinitionin interface- TilesContainer
- Parameters:
- definitionName- the name of the definition.
- request- The request.
- Returns:
- true if the definition is found.
 
- 
getDefinitionReturns a definition specifying its name.- Specified by:
- getDefinitionin interface- TilesContainer
- Parameters:
- definitionName- The name of the definition to find.
- request- The request context.
- Returns:
- The definition, if found.
 
- 
getContextStackReturns the context stack.- Parameters:
- tilesContext- The Tiles context object to use.
- Returns:
- The needed stack of contexts.
- Since:
- 2.0.6
 
- 
pushContextPushes a context object in the stack.- Parameters:
- context- The context to push.
- tilesContext- The Tiles context object to use.
- Since:
- 2.0.6
 
- 
popContextPops a context object out of the stack.- Parameters:
- tilesContext- The Tiles context object to use.
- Returns:
- The popped context object.
- Since:
- 2.0.6
 
- 
getContextGet attribute context from request.- Parameters:
- tilesContext- current Tiles application context.
- Returns:
- BasicAttributeContext or null if context is not found.
- Since:
- 2.0.6
 
- 
renderRenders the specified attribute context.- Parameters:
- request- The request context.
- attributeContext- The context to render.
- Throws:
- InvalidTemplateException- If the template is not valid.
- CannotRenderException- If something goes wrong during rendering.
- Since:
- 2.1.3
 
 
-