1 7 package com.inversoft.verge.mvc.config; 8 9 10 import java.util.ArrayList ; 11 import java.util.Collection ; 12 import java.util.HashMap ; 13 import java.util.List ; 14 import java.util.Map ; 15 16 import com.inversoft.verge.util.WebBean; 17 18 19 27 public class BaseFormConfig extends BaseConfig { 28 29 33 private Map formBeans; 34 private List formBeanRIDs; 35 private List validators; 36 private boolean isValidating; 37 38 39 public BaseFormConfig(String name) { 40 super(name); 41 formBeans = new HashMap (); 42 validators = new ArrayList (); 43 formBeanRIDs = new ArrayList (); 44 isValidating = false; 45 } 46 47 53 public BaseFormConfig(BaseFormConfig base) { 54 super(base.getName()); 55 formBeans = base.formBeans; 56 validators = new ArrayList (base.validators); 57 formBeanRIDs = new ArrayList (base.formBeanRIDs); 58 isValidating = base.isValidating; 59 } 60 61 62 65 public WebBean getFormBean(String name) { 66 return (WebBean) formBeans.get(name); 67 } 68 69 72 public void addFormBean(WebBean formBean) { 73 formBeans.put(formBean.getID(), formBean); 74 } 75 76 81 public Collection getFormBeans() { 82 return formBeans.values(); 83 } 84 85 92 public List getFormBeanRIDs() { 93 return new ArrayList (formBeanRIDs); 94 } 95 96 101 public void addFormBeanRID(String formBeanRID) { 102 this.formBeanRIDs.add(formBeanRID); 103 } 104 105 110 public boolean isFormBeanRepository(String name) { 111 return (formBeanRIDs.contains(name)); 112 } 113 114 117 public boolean isValidating() { 118 return isValidating; 119 } 120 121 126 public void addValidatorConfig(BaseValidatorConfig validator) { 127 validators.add(validator); 128 isValidating |= validator.isValidating(); 129 } 130 131 138 public List getValidators() { 139 return new ArrayList (validators); 140 } 141 } | Popular Tags |