1 18 package org.apache.beehive.netui.pageflow; 19 20 import java.util.Collection ; 21 import java.util.Iterator ; 22 import java.util.Map ; 23 import java.util.Set ; 24 import org.apache.struts.validator.DynaValidatorForm; 25 26 27 31 public class DynaFormData 32 extends DynaValidatorForm 33 implements Map 34 { 35 public void clear() 36 { 37 dynaValues.clear(); 38 } 39 40 public boolean containsKey( Object key ) 41 { 42 return dynaValues.containsKey( key ); 43 } 44 45 public boolean containsValue( Object value ) 46 { 47 return dynaValues.containsValue( value ); 48 } 49 50 public Set entrySet() 51 { 52 return dynaValues.entrySet(); 53 } 54 55 public Object get( Object name ) 56 { 57 return super.get( name.toString() ); 58 } 59 60 public boolean isEmpty() 61 { 62 return dynaValues.isEmpty(); 63 } 64 65 public Set keySet() 66 { 67 return dynaValues.keySet(); 68 } 69 70 public Object put( Object key, Object value ) 71 { 72 String keyStr = key.toString(); 73 set( keyStr, value ); 74 return get( key ); 75 } 76 77 public void putAll( Map map ) 78 { 79 for ( Iterator i = map.entrySet().iterator(); i.hasNext(); ) 80 { 81 Map.Entry entry = ( Map.Entry ) i.next(); 82 set( entry.getKey().toString(), entry.getValue() ); 83 } 84 } 85 86 public Object remove( Object key ) 87 { 88 return dynaValues.remove( key ); 89 } 90 91 public int size() 92 { 93 return dynaValues.size(); 94 } 95 96 public Collection values() 97 { 98 return dynaValues.values(); 99 } 100 } 101 102 | Popular Tags |