Class DynamicActionAttributeSupport
- java.lang.Object
-
- net.sf.basedb.clients.web.extensions.DynamicActionAttributeSupport
-
- All Implemented Interfaces:
DynamicActionAttributes
- Direct Known Subclasses:
ButtonBean
,MenuItemBean
,TabBean
public abstract class DynamicActionAttributeSupport extends Object implements DynamicActionAttributes
Abstract base class intended to be extended byAction
implementations that want to support dynamic action attributes. Typically, if the action factory descends fromAbstractJspFactory
.- Since:
- 3.3
- Author:
- nicklas
-
-
Field Summary
Fields Modifier and Type Field Description private Iterator<DynamicActionAttribute>
dynamicAttributes
private Map<String,DynamicActionAttribute>
moreAttributes
private DynamicActionAttributes
source
-
Constructor Summary
Constructors Modifier Constructor Description protected
DynamicActionAttributeSupport()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
addAttributes(StringBuilder sb, Iterator<DynamicActionAttribute> it)
Append all dynamic action attributes to the string builder.static String
getAttributesString(Object action)
If the object implements DynamicActionAttributes interface, get a string with all dynamic attributes, otherwise an empty string.Iterator<DynamicActionAttribute>
getDynamicActionAttributes()
Get an iterator that return all dynamic attributes.void
setDynamicActionAttributesSource(DynamicActionAttributes source)
Set the source of dynamic action attributes.void
setDynamicAttribute(String name, Object value)
Adds a dynamic attribute to the action.
-
-
-
Field Detail
-
dynamicAttributes
private Iterator<DynamicActionAttribute> dynamicAttributes
-
source
private DynamicActionAttributes source
-
moreAttributes
private Map<String,DynamicActionAttribute> moreAttributes
-
-
Method Detail
-
getAttributesString
public static String getAttributesString(Object action)
If the object implements DynamicActionAttributes interface, get a string with all dynamic attributes, otherwise an empty string.
-
addAttributes
public static void addAttributes(StringBuilder sb, Iterator<DynamicActionAttribute> it)
Append all dynamic action attributes to the string builder.
-
getDynamicActionAttributes
public Iterator<DynamicActionAttribute> getDynamicActionAttributes()
Description copied from interface:DynamicActionAttributes
Get an iterator that return all dynamic attributes. If no dynamic attributes have been defined, the method may return null or an iterator that doesn't return any elements.- Specified by:
getDynamicActionAttributes
in interfaceDynamicActionAttributes
- Returns:
- An iterator or null
-
setDynamicActionAttributesSource
public void setDynamicActionAttributesSource(DynamicActionAttributes source)
Set the source of dynamic action attributes. The source is another instance of an object that implements theDynamicActionAttributes
interface.
-
setDynamicAttribute
public void setDynamicAttribute(String name, Object value)
Adds a dynamic attribute to the action. The name should be unique or it will overwrite any existing attribute. Attributes that are set via this method are merged with attributes that are set viasetDynamicActionAttributesSource(DynamicActionAttributes)
. Duplicates are not removed in this case.- Since:
- 3.16
-
-