public class BasicTilesContainer extends Object implements TilesContainer, AttributeEvaluatorFactoryAware
Constructor and Description |
---|
BasicTilesContainer() |
Modifier and Type | Method and Description |
---|---|
void |
endContext(Request request)
Ends a context, where attribute values are stored independently of others.
It must be called after a TilesContainer.startContext(Request) call. |
Object |
evaluate(Attribute attribute,
Request request)
Evaluates the given attribute.
|
ApplicationContext |
getApplicationContext()
Returns the Tiles application context used by this container.
|
AttributeContext |
getAttributeContext(Request request)
Retrieve the attribute context of the current request.
|
protected AttributeContext |
getContext(Request tilesContext)
Get attribute context from request.
|
protected Deque<AttributeContext> |
getContextStack(Request tilesContext)
Returns the context stack.
|
Definition |
getDefinition(String definitionName,
Request request)
Returns a definition specifying its name.
|
boolean |
isValidDefinition(String definitionName,
Request request)
Determine whether the definition exists.
|
protected AttributeContext |
popContext(Request tilesContext)
Pops a context object out of the stack.
|
void |
prepare(String preparer,
Request request)
Executes a preparer.
|
protected void |
pushContext(AttributeContext context,
Request tilesContext)
Pushes a context object in the stack.
|
void |
render(Attribute attr,
Request request)
Render the given Attribute.
|
void |
render(Definition definition,
Request request)
Renders the specified definition.
|
protected void |
render(Request request,
AttributeContext attributeContext)
Renders the specified attribute context.
|
void |
render(String definitionName,
Request request)
Render the given tiles request.
|
void |
renderContext(Request request)
Renders the current context, as it is.
|
void |
setApplicationContext(ApplicationContext context)
Sets the Tiles application context to use.
|
void |
setAttributeEvaluatorFactory(AttributeEvaluatorFactory attributeEvaluatorFactory)
Sets the attribute evaluator factory.
|
void |
setDefinitionsFactory(DefinitionsFactory definitionsFactory)
Set the definitions factory.
|
void |
setPreparerFactory(PreparerFactory preparerFactory)
Set the preparerInstance factory.
|
void |
setRendererFactory(RendererFactory rendererFactory)
Sets the renderer instance factory.
|
AttributeContext |
startContext(Request request)
Starts a new context, where attribute values are stored independently of others.
When the use of the contexts is finished, call TilesContainer.endContext(Request) |
public AttributeContext startContext(Request request)
TilesContainer.endContext(Request)
startContext
in interface TilesContainer
request
- The request.public void endContext(Request request)
TilesContainer.startContext(Request)
call.endContext
in interface TilesContainer
request
- The request.public void renderContext(Request request)
renderContext
in interface TilesContainer
request
- The request.public ApplicationContext getApplicationContext()
getApplicationContext
in interface TilesContainer
public void setApplicationContext(ApplicationContext context)
context
- The Tiles application context.public AttributeContext getAttributeContext(Request request)
getAttributeContext
in interface TilesContainer
request
- The request.public void setDefinitionsFactory(DefinitionsFactory definitionsFactory)
definitionsFactory
- the definitions factory for this instance.public void setPreparerFactory(PreparerFactory preparerFactory)
preparerFactory
- the preparerInstance factory for this conainer.public void setRendererFactory(RendererFactory rendererFactory)
rendererFactory
- the renderer instance factory for this container.public void setAttributeEvaluatorFactory(AttributeEvaluatorFactory attributeEvaluatorFactory)
setAttributeEvaluatorFactory
in interface AttributeEvaluatorFactoryAware
attributeEvaluatorFactory
- The attribute evaluator factory to use.public void prepare(String preparer, Request request)
prepare
in interface TilesContainer
preparer
- The name of the preparer to execute.request
- The request.public void render(String definitionName, Request request)
render
in interface TilesContainer
definitionName
- the current definition.request
- The request.public void render(Definition definition, Request request)
render
in interface TilesContainer
definition
- The definition to render.request
- The request context.public void render(Attribute attr, Request request) throws IOException
render
in interface TilesContainer
attr
- The attribute to render.request
- The request.IOException
- If something goes wrong during writing to the output.public Object evaluate(Attribute attribute, Request request)
evaluate
in interface TilesContainer
attribute
- The attribute to evaluate.request
- The request.public boolean isValidDefinition(String definitionName, Request request)
isValidDefinition
in interface TilesContainer
definitionName
- the name of the definition.request
- The request.public Definition getDefinition(String definitionName, Request request)
getDefinition
in interface TilesContainer
definitionName
- The name of the definition to find.request
- The request context.protected Deque<AttributeContext> getContextStack(Request tilesContext)
tilesContext
- The Tiles context object to use.protected void pushContext(AttributeContext context, Request tilesContext)
context
- The context to push.tilesContext
- The Tiles context object to use.protected AttributeContext popContext(Request tilesContext)
tilesContext
- The Tiles context object to use.protected AttributeContext getContext(Request tilesContext)
tilesContext
- current Tiles application context.protected void render(Request request, AttributeContext attributeContext)
request
- The request context.attributeContext
- The context to render.InvalidTemplateException
- If the template is not valid.CannotRenderException
- If something goes wrong during rendering.Copyright © 2000–2024 Apache Software Foundation. All rights reserved.