|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap org.apache.cocoon.forms.util.ContainerWidgetAsMap
public class ContainerWidgetAsMap
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 Action
. The result in that case is always
null
. This is to allow global retrieving or filling of the map values.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
---|
Map.Entry<K,V> |
Field Summary | |
---|---|
protected AbstractContainerWidget |
container
|
Constructor Summary | |
---|---|
ContainerWidgetAsMap(AbstractContainerWidget container)
Same as ContainerWidgetAsMap(container, false) |
|
ContainerWidgetAsMap(AbstractContainerWidget container,
boolean keysToLowerCase)
Wraps a container widget in a Map . |
Method Summary | |
---|---|
Set |
entrySet()
|
Object |
get(Object key)
|
ContainerWidget |
getWidget()
Get the container widget that is wrapped by this Map . |
Widget |
getWidget(String path)
Get a widget relative to the container wrapped by this Map |
Object |
put(Object key,
Object value)
Put a value in a child widget. |
void |
putAll(Map map)
|
Methods inherited from class java.util.AbstractMap |
---|
clear, clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, remove, size, toString, values |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected AbstractContainerWidget container
Constructor Detail |
---|
public ContainerWidgetAsMap(AbstractContainerWidget container, boolean keysToLowerCase)
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).
container
- the container to wrapkeysToLowerCase
- should we convert keys to lower case?public ContainerWidgetAsMap(AbstractContainerWidget container)
ContainerWidgetAsMap(container, false)
Method Detail |
---|
public ContainerWidget getWidget()
Map
.
ContainerWidget
public Widget getWidget(String path)
Map
path
- a widget lookup path
path
or null
if it doesn't exist.Widget.lookupWidget(String)
public Object put(Object key, Object value)
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.
put
in interface Map
put
in class AbstractMap
public void putAll(Map map)
putAll
in interface Map
putAll
in class AbstractMap
public Object get(Object key)
get
in interface Map
get
in class AbstractMap
public Set entrySet()
entrySet
in interface Map
entrySet
in class AbstractMap
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |