This project has retired. For details please refer to its Attic page.
InsertAttributeTag (Tiles 2 2.1.4 API)

org.apache.tiles.jsp.taglib
Class InsertAttributeTag

Package class diagram package InsertAttributeTag
java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.tiles.jsp.taglib.TilesBodyTag
              extended by org.apache.tiles.jsp.taglib.RenderTag
                  extended by org.apache.tiles.jsp.taglib.InsertAttributeTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, JspTag, Tag, TryCatchFinally, PutAttributeTagParent, PutListAttributeTagParent
Direct Known Subclasses:
GetAsStringTag

public class InsertAttributeTag
extends RenderTag

This is the tag handler for <tiles:attribute>, which defines an attribute. If the attribute value is a template or a definition, its attributes and its template can be overridden.

Version:
$Rev: 736275 $ $Date: 2009-01-21 10:58:20 +0100 (mer, 21 gen 2009) $
See Also:
Serialized Form

Field Summary
protected  Attribute attribute
          The evaluated attribute.
protected  Object defaultValue
          This value is evaluated only if value is null and the attribute with the associated name is null.
protected  String defaultValueRole
          The role to check for the default value.
protected  String defaultValueType
          The type of the defaultValue, if it is a string.
protected  String name
          Name to insert.
protected  Object value
          The value of the attribute.
 
Fields inherited from class org.apache.tiles.jsp.taglib.RenderTag
attributeContext, container, flush, ignore, preparer, role
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
InsertAttributeTag()
           
 
Method Summary
 int doStartTag()
          
 Object getDefaultValue()
          Returns the default value, that is evaluated only if value is null and the attribute with the associated name is null.
 String getDefaultValueRole()
          Returns the role to check for the default value.
 String getDefaultValueType()
          Returns the default value type.
 String getName()
          Returns the name of the attribute.
 Object getValue()
          Get the value.
protected  void render()
          Render the specified content.
protected  void render(Attribute attr)
          Renders an attribute for real.
protected  void reset()
          Release any per-invocation resources, resetting any resources or state that should be cleared between successive invocations of Tag.doEndTag() and Tag.doStartTag().
 void setDefaultValue(Object defaultValue)
          Sets the default value, that is evaluated only if value is null and the attribute with the associated name is null.
 void setDefaultValueRole(String defaultValueRole)
          Sets the role to check for the default value.
 void setDefaultValueType(String defaultValueType)
          Sets the default value type.
 void setName(String value)
          Sets the name of the attribute.
 void setValue(Object value)
          Set the value.
protected  void startContext(PageContext context)
          Starts the context when entering the tag.
 
Methods inherited from class org.apache.tiles.jsp.taglib.RenderTag
doEndTag, endContext, getPreparer, getRole, isFlush, isIgnore, processNestedTag, processNestedTag, setFlush, setIgnore, setPreparer, setRole
 
Methods inherited from class org.apache.tiles.jsp.taglib.TilesBodyTag
doCatch, doFinally, release
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doAfterBody, doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

name

protected String name
Name to insert.


value

protected Object value
The value of the attribute.


defaultValue

protected Object defaultValue
This value is evaluated only if value is null and the attribute with the associated name is null.

Since:
2.1.2

defaultValueType

protected String defaultValueType
The type of the defaultValue, if it is a string.

Since:
2.1.2

defaultValueRole

protected String defaultValueRole
The role to check for the default value. If the user is in the specified role, the default value is taken into account; otherwise, it is ignored (skipped).

Since:
2.1.2

attribute

protected Attribute attribute
The evaluated attribute.

Since:
2.1.0
Constructor Detail

InsertAttributeTag

public InsertAttributeTag()
Method Detail

setName

public void setName(String value)
Sets the name of the attribute.

Parameters:
value - The name of the attribute.

getName

public String getName()
Returns the name of the attribute.

Returns:
The name of the attribute.

getValue

public Object getValue()
Get the value.

Returns:
The value.

setValue

public void setValue(Object value)
Set the value.

Parameters:
value - The new value

getDefaultValue

public Object getDefaultValue()
Returns the default value, that is evaluated only if value is null and the attribute with the associated name is null.

Returns:
The default value.

setDefaultValue

public void setDefaultValue(Object defaultValue)
Sets the default value, that is evaluated only if value is null and the attribute with the associated name is null.

Parameters:
defaultValue - The default value to set.

getDefaultValueType

public String getDefaultValueType()
Returns the default value type. It will be used only if getDefaultValue() is a string.

Returns:
The default value type.

setDefaultValueType

public void setDefaultValueType(String defaultValueType)
Sets the default value type. To be used in conjunction with setDefaultValue(Object) when passing a string.

Parameters:
defaultValueType - The default value type.

getDefaultValueRole

public String getDefaultValueRole()
Returns the role to check for the default value. If the user is in the specified role, the default value is taken into account; otherwise, it is ignored (skipped).

Returns:
The default value role.

setDefaultValueRole

public void setDefaultValueRole(String defaultValueRole)
Sets the role to check for the default value. If the user is in the specified role, the default value is taken into account; otherwise, it is ignored (skipped).

Parameters:
defaultValueRole - The default value role.

reset

protected void reset()
Release any per-invocation resources, resetting any resources or state that should be cleared between successive invocations of Tag.doEndTag() and Tag.doStartTag().

Overrides:
reset in class RenderTag

doStartTag

public int doStartTag()
               throws TilesJspException

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class RenderTag
Throws:
TilesJspException

render

protected void render()
               throws TilesJspException,
                      IOException
Render the specified content.

Specified by:
render in class RenderTag
Throws:
TilesJspException - if a jsp exception occurs.
IOException - if an io exception occurs.

startContext

protected void startContext(PageContext context)
Starts the context when entering the tag.

Overrides:
startContext in class RenderTag
Parameters:
context - The page context to use.

render

protected void render(Attribute attr)
               throws IOException
Renders an attribute for real.

Parameters:
attr - The attribute to render.
Throws:
IOException - If something goes wrong during the reading of definition files.


Copyright © 2001-2009 Apache Software Foundation. All Rights Reserved.