public abstract class ERXDynamicElement extends com.webobjects.appserver._private.WODynamicGroup
All subclasses of ERXDynamicElement have to be thread safe! The WOAssociation objects
are thread safe as they don't hold a specific value but are used to retrieve the correct
value from the current parent component. If you want or have to store values in instance
variables use the inner class ERXDynamicElement.ContextData
as value holder. Those objects will
store values indirectly within the current context which means you can declare them as
static.
Modifier and Type | Class and Description |
---|---|
protected static class |
ERXDynamicElement.ContextData<T>
This class is used to store values that cannot be stored in instance variables as
dynamic elements have to be thread-safe.
|
Modifier and Type | Field and Description |
---|---|
protected org.apache.log4j.Logger |
log |
_children
_ConstructorParameters
Constructor and Description |
---|
ERXDynamicElement(String name,
NSDictionary<String,WOAssociation> associations,
NSMutableArray<WOElement> children) |
ERXDynamicElement(String name,
NSDictionary<String,WOAssociation> associations,
WOElement template) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterProcessing(WOContext context)
Convenience method to override if you want to store values in ContextData object.
|
protected void |
appendTagAttributeToResponse(WOResponse response,
String name,
Object value)
Appends the attribute to the response.
|
<T> NSArray<T> |
arrayValueForBinding(String name,
NSArray<T> defaultValue,
WOComponent component)
Resolves a given binding as an NSArray object.
|
<T> NSArray<T> |
arrayValueForBinding(String name,
WOComponent component)
Resolves a given binding as an NSArray object.
|
NSDictionary<String,WOAssociation> |
associations()
Returns the element's association dictionary.
|
protected void |
beforeProcessing(WOContext context)
Convenience method to override if you want to store values in ContextData object.
|
boolean |
bindingIsSettable(String name)
Checks if the association for a binding with the given name can assign
values at runtime.
|
WOAssociation |
bindingNamed(String name)
Returns the association for a binding with the given name.
|
boolean |
booleanValueForBinding(String name,
boolean defaultValue,
WOComponent component)
Retrieves the current boolean value of the given binding from the component.
|
boolean |
booleanValueForBinding(String name,
WOComponent component)
Retrieves the current boolean value of the given binding from the component.
|
boolean |
hasBinding(String name)
Checks if there is an association for a binding with the given name.
|
String |
id(WOContext context)
Return the value of the id binding if it exists or a safe identifier
otherwise.
|
int |
integerValueForBinding(String name,
int defaultValue,
WOComponent component)
Retrieves the current int value of the given binding from the component.
|
protected String |
nameInContext(WOContext context)
Returns the name of this element within the given context.
|
boolean |
secureInContext(WOContext context)
Checks if we are in secure mode by checking the secure binding or the
context's secure mode as fallback.
|
void |
setValueForBinding(Object value,
String name,
WOComponent component)
Will try to set the given binding in the component to the passed value.
|
String |
stringValueForBinding(String name,
String defaultValue,
WOComponent component)
Retrieves the current string value of the given binding from the component.
|
String |
stringValueForBinding(String name,
WOComponent component)
Retrieves the current string value of the given binding from the component.
|
Object |
valueForBinding(String name,
Object defaultValue,
WOComponent component)
Retrieves the current value of the given binding from the component.
|
Object |
valueForBinding(String name,
WOComponent component)
Retrieves the current value of the given binding from the component.
|
addChildElement, appendChildrenToResponse, appendToResponse, childrenElements, EmptyGroup, hasChildrenElements, invokeAction, invokeChildrenAction, takeChildrenValuesFromRequest, takeValuesFromRequest, toString
public ERXDynamicElement(String name, NSDictionary<String,WOAssociation> associations, WOElement template)
public ERXDynamicElement(String name, NSDictionary<String,WOAssociation> associations, NSMutableArray<WOElement> children)
public NSDictionary<String,WOAssociation> associations()
public String id(WOContext context)
context
- context of the transactionprotected String nameInContext(WOContext context)
context
- context of the transactionpublic boolean secureInContext(WOContext context)
context
- context of the transactiontrue
if in secure modepublic boolean hasBinding(String name)
name
- binding nametrue
if the association existspublic WOAssociation bindingNamed(String name)
null
will be returned.name
- binding namenull
public boolean bindingIsSettable(String name)
name
- binding nametrue
if binding is settablepublic void setValueForBinding(Object value, String name, WOComponent component)
value
- new value for the bindingname
- binding namecomponent
- component to set the value inpublic Object valueForBinding(String name, Object defaultValue, WOComponent component)
null
the default
value will be returned.name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic Object valueForBinding(String name, WOComponent component)
null
will be returned.name
- binding namecomponent
- component to get value fromnull
public String stringValueForBinding(String name, String defaultValue, WOComponent component)
null
the default
value will be returned.name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic String stringValueForBinding(String name, WOComponent component)
null
will be returned.name
- binding namecomponent
- component to get value fromnull
public boolean booleanValueForBinding(String name, boolean defaultValue, WOComponent component)
name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic boolean booleanValueForBinding(String name, WOComponent component)
false
will be returned.name
- binding namecomponent
- component to get value fromfalse
public int integerValueForBinding(String name, int defaultValue, WOComponent component)
name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic <T> NSArray<T> arrayValueForBinding(String name, WOComponent component)
T
- the type of the array's itemsname
- binding namecomponent
- component to get value fromnull
public <T> NSArray<T> arrayValueForBinding(String name, NSArray<T> defaultValue, WOComponent component)
T
- the type of the array's itemsname
- binding namedefaultValue
- default valuecomponent
- component to get value fromprotected void appendTagAttributeToResponse(WOResponse response, String name, Object value)
null
the appending is skipped.response
- the current responsename
- the attribute namevalue
- the attribute valueprotected void beforeProcessing(WOContext context)
ERXDynamicElement.ContextData.begin(WOContext, Object)
on your ContextData objects. This method should then
be called at the beginning of the WODynamicGroup.appendToResponse(WOResponse, WOContext)
,
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext)
and WODynamicGroup.invokeAction(WORequest, WOContext)
.context
- context of the transactionprotected void afterProcessing(WOContext context)
ERXDynamicElement.ContextData.end(WOContext)
on your ContextData objects. This method should then
be called at the end of the WODynamicGroup.appendToResponse(WOResponse, WOContext)
,
WODynamicGroup.takeValuesFromRequest(WORequest, WOContext)
and WODynamicGroup.invokeAction(WORequest, WOContext)
.context
- context of the transactionCopyright © 2002 – 2024 Project Wonder.