| java.lang.Object java.util.AbstractMap org.apache.cocoon.forms.util.ContainerWidgetAsMap
ContainerWidgetAsMap | public class ContainerWidgetAsMap extends AbstractMap (Code) | | A Map view of a container widget, keys being children names and values either
maps (for container children), objects (for terminal children) or lists (for repeaters).
The returned map is non-modifiable, except using the put() method, which much
refer to an existing child widget, and putAll(Map) that will silently ignore keys
that don't refer to existing child widgets.
Also, this map accepts getting and setting values for keys that correspond to value-less widgets
such as
org.apache.cocoon.forms.formmodel.Action . The result in that case is always
null . This is to allow global retrieving or filling of the map values.
since: 2.1.8 version: $Id: ContainerWidgetAsMap.java 449149 2006-09-23 03:58:05Z crossley $ |
ContainerWidgetAsMap | public ContainerWidgetAsMap(AbstractContainerWidget container, boolean keysToLowerCase)(Code) | | Wraps a container widget in a Map .
The keysToLowerCase argument specifies if input keys given in get() ,
put() and putAll() should be converted to lower case before searching for
the corresponding widget. This feature allows to directly feed widgets with Map s coming
from JDBC resultset rows where keys are uppercase (see JDBI).
Parameters: container - the container to wrap Parameters: keysToLowerCase - should we convert keys to lower case? |
getWidget | public Widget getWidget(String path)(Code) | | Get a widget relative to the container wrapped by this Map
Parameters: path - a widget lookup path the widget pointed to by path or null if it doesn't exist. See Also: Widget.lookupWidget(String) |
put | public Object put(Object key, Object value)(Code) | | Put a value in a child widget. The value must be compatible with the datatype
expected by the child widget. In the case of repeaters and containers, this
datatype is Collection and Map respectively, which
will be used to fill the rows and child widgets.
Note also that the contract of put requires the previous value
to be returned. In the case of repeaters and containers, the value is a live
wrapper around the actual widget, meaning that it's not different from the
current value.
|
|
|