01: package org.jreform.internal;
02:
03: import java.util.HashMap;
04: import java.util.Map;
05:
06: import org.jreform.CheckableState;
07: import org.jreform.Criterion;
08: import org.jreform.InputDataType;
09: import org.jreform.Radio;
10:
11: /**
12: * @author armandino (at) gmail.com
13: */
14: class RadioImpl<T> extends InputImpl<T> implements Radio<T> {
15: private Map<String, CheckableState> stateMap;
16:
17: RadioImpl(InputDataType<T> type, String name,
18: Criterion<T>... criteria) {
19: super (type, name, criteria);
20:
21: stateMap = new DefaultValueMap<String, CheckableState>(
22: new HashMap<String, CheckableState>(),
23: CheckableState.UNCHECKED);
24: }
25:
26: public void setValueAttribute(String valueAttribute) {
27: super .setValueAttribute(valueAttribute);
28: stateMap.put(getValueAttribute(), CheckableState.CHECKED);
29: }
30:
31: public Map<String, CheckableState> getState() {
32: return stateMap;
33: }
34:
35: }
|