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.
|
Constructor and Description |
---|
ERXDynamicElement(String name,
NSDictionary<String,com.webobjects.appserver.WOAssociation> associations,
NSMutableArray<com.webobjects.appserver.WOElement> children) |
ERXDynamicElement(String name,
NSDictionary<String,com.webobjects.appserver.WOAssociation> associations,
com.webobjects.appserver.WOElement template) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterProcessing(com.webobjects.appserver.WOContext context)
Convenience method to override if you want to store values in ContextData object.
|
protected void |
appendTagAttributeToResponse(com.webobjects.appserver.WOResponse response,
String name,
Object value)
Appends the attribute to the response.
|
<T> NSArray<T> |
arrayValueForBinding(String name,
NSArray<T> defaultValue,
com.webobjects.appserver.WOComponent component)
Resolves a given binding as an NSArray object.
|
<T> NSArray<T> |
arrayValueForBinding(String name,
com.webobjects.appserver.WOComponent component)
Resolves a given binding as an NSArray object.
|
NSDictionary<String,com.webobjects.appserver.WOAssociation> |
associations()
Returns the element's association dictionary.
|
protected void |
beforeProcessing(com.webobjects.appserver.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.
|
com.webobjects.appserver.WOAssociation |
bindingNamed(String name)
Returns the association for a binding with the given name.
|
boolean |
booleanValueForBinding(String name,
boolean defaultValue,
com.webobjects.appserver.WOComponent component)
Retrieves the current boolean value of the given binding from the component.
|
boolean |
booleanValueForBinding(String name,
com.webobjects.appserver.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(com.webobjects.appserver.WOContext context)
Return the value of the id binding if it exists or a safe identifier
otherwise.
|
int |
integerValueForBinding(String name,
int defaultValue,
com.webobjects.appserver.WOComponent component)
Retrieves the current int value of the given binding from the component.
|
protected String |
nameInContext(com.webobjects.appserver.WOContext context)
Returns the name of this element within the given context.
|
boolean |
secureInContext(com.webobjects.appserver.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,
com.webobjects.appserver.WOComponent component)
Will try to set the given binding in the component to the passed value.
|
String |
stringValueForBinding(String name,
String defaultValue,
com.webobjects.appserver.WOComponent component)
Retrieves the current string value of the given binding from the component.
|
String |
stringValueForBinding(String name,
com.webobjects.appserver.WOComponent component)
Retrieves the current string value of the given binding from the component.
|
Object |
valueForBinding(String name,
Object defaultValue,
com.webobjects.appserver.WOComponent component)
Retrieves the current value of the given binding from the component.
|
Object |
valueForBinding(String name,
com.webobjects.appserver.WOComponent component)
Retrieves the current value of the given binding from the component.
|
protected Logger log
public ERXDynamicElement(String name, NSDictionary<String,com.webobjects.appserver.WOAssociation> associations, com.webobjects.appserver.WOElement template)
public ERXDynamicElement(String name, NSDictionary<String,com.webobjects.appserver.WOAssociation> associations, NSMutableArray<com.webobjects.appserver.WOElement> children)
public NSDictionary<String,com.webobjects.appserver.WOAssociation> associations()
public String id(com.webobjects.appserver.WOContext context)
context
- context of the transactionprotected String nameInContext(com.webobjects.appserver.WOContext context)
context
- context of the transactionpublic boolean secureInContext(com.webobjects.appserver.WOContext context)
context
- context of the transactiontrue
if in secure modepublic boolean hasBinding(String name)
name
- binding nametrue
if the association existspublic com.webobjects.appserver.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, com.webobjects.appserver.WOComponent component)
value
- new value for the bindingname
- binding namecomponent
- component to set the value inpublic Object valueForBinding(String name, Object defaultValue, com.webobjects.appserver.WOComponent component)
null
the default
value will be returned.name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic Object valueForBinding(String name, com.webobjects.appserver.WOComponent component)
null
will be returned.name
- binding namecomponent
- component to get value fromnull
public String stringValueForBinding(String name, String defaultValue, com.webobjects.appserver.WOComponent component)
null
the default
value will be returned.name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic String stringValueForBinding(String name, com.webobjects.appserver.WOComponent component)
null
will be returned.name
- binding namecomponent
- component to get value fromnull
public boolean booleanValueForBinding(String name, boolean defaultValue, com.webobjects.appserver.WOComponent component)
name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic boolean booleanValueForBinding(String name, com.webobjects.appserver.WOComponent component)
false
will be returned.name
- binding namecomponent
- component to get value fromfalse
public int integerValueForBinding(String name, int defaultValue, com.webobjects.appserver.WOComponent component)
name
- binding namedefaultValue
- default valuecomponent
- component to get value frompublic <T> NSArray<T> arrayValueForBinding(String name, com.webobjects.appserver.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, com.webobjects.appserver.WOComponent component)
T
- the type of the array's itemsname
- binding namedefaultValue
- default valuecomponent
- component to get value fromprotected void appendTagAttributeToResponse(com.webobjects.appserver.WOResponse response, String name, Object value)
null
the appending is skipped.response
- the current responsename
- the attribute namevalue
- the attribute valueprotected void beforeProcessing(com.webobjects.appserver.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(com.webobjects.appserver.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 – 2020 Project Wonder.