|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tiles.renderer.impl.AbstractBaseAttributeRenderer
public abstract class AbstractBaseAttributeRenderer
Base abstract class that manages authorization to display the attribute.
Field Summary | |
---|---|
protected TilesApplicationContext |
applicationContext
The Tiles application context. |
protected TilesRequestContextFactory |
contextFactory
The Tiles request context factory. |
protected AttributeEvaluator |
evaluator
The attribute evaluator. |
Constructor Summary | |
---|---|
AbstractBaseAttributeRenderer()
|
Method Summary | |
---|---|
protected TilesRequestContext |
getRequestContext(Object... requestItems)
Creates a Tiles request context from request items. |
protected boolean |
isPermitted(TilesRequestContext request,
Set<String> roles)
Checks if the current user is in one of the comma-separated roles specified in the role parameter. |
void |
render(Attribute attribute,
TilesRequestContext request)
Renders an attribute. |
void |
setApplicationContext(TilesApplicationContext applicationContext)
Sets the Tiles application context. |
void |
setEvaluator(AttributeEvaluator evaluator)
Sets the evaluator. |
void |
setRequestContextFactory(TilesRequestContextFactory contextFactory)
Sets the Tiles request context factory. |
abstract void |
write(Object value,
Attribute attribute,
TilesRequestContext request)
Implement this method knowing that the attribute won't be null and it will be authorized. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected TilesRequestContextFactory contextFactory
protected TilesApplicationContext applicationContext
protected AttributeEvaluator evaluator
Constructor Detail |
---|
public AbstractBaseAttributeRenderer()
Method Detail |
---|
public void setRequestContextFactory(TilesRequestContextFactory contextFactory)
setRequestContextFactory
in interface TilesRequestContextFactoryAware
contextFactory
- The Tiles context factory.public void setApplicationContext(TilesApplicationContext applicationContext)
setApplicationContext
in interface TilesApplicationContextAware
applicationContext
- The Tiles application context.public void setEvaluator(AttributeEvaluator evaluator)
setEvaluator
in interface AttributeEvaluatorAware
evaluator
- The evaluator to set.public void render(Attribute attribute, TilesRequestContext request) throws IOException
render
in interface AttributeRenderer
attribute
- The attribute to render.request
- The Tiles request context.
IOException
- If something goes wrong during rendition.public abstract void write(Object value, Attribute attribute, TilesRequestContext request) throws IOException
value
- The value of the attribute to be rendered.attribute
- The attribute to render.request
- The Tiles request object.
IOException
- If something goes wrong during rendition.protected TilesRequestContext getRequestContext(Object... requestItems)
requestItems
- The request items.
protected boolean isPermitted(TilesRequestContext request, Set<String> roles)
role
parameter.
request
- The request context.roles
- The list of roles.
true
if the current user is in one of those roles.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |