1 23 24 29 30 package com.sun.enterprise.tools.common.dd.webapp; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class CacheHelper extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String NAME = "Name"; static public final String CLASSNAME = "ClassName"; static public final String PROPERTY = "WebProperty"; 48 public CacheHelper() { 49 this(Common.USE_DEFAULT_VALUES); 50 } 51 52 public CacheHelper(int options) 53 { 54 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 55 this.createProperty("property", PROPERTY, 58 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 59 WebProperty.class); 60 this.createAttribute(PROPERTY, "name", "Name", 61 AttrProp.CDATA | AttrProp.REQUIRED, 62 null, null); 63 this.createAttribute(PROPERTY, "value", "Value", 64 AttrProp.CDATA | AttrProp.REQUIRED, 65 null, null); 66 this.initialize(options); 67 } 68 69 void initialize(int options) 71 { 72 73 } 74 75 public void setName(java.lang.String value) { 77 setAttributeValue(NAME, value); 78 } 79 80 public java.lang.String getName() { 82 return getAttributeValue(NAME); 83 } 84 85 public void setClassName(java.lang.String value) { 87 setAttributeValue(CLASSNAME, value); 88 } 89 90 public java.lang.String getClassName() { 92 return getAttributeValue(CLASSNAME); 93 } 94 95 public void setWebProperty(int index, WebProperty value) { 97 this.setValue(PROPERTY, index, value); 98 } 99 100 public WebProperty getWebProperty(int index) { 102 return (WebProperty)this.getValue(PROPERTY, index); 103 } 104 105 public void setWebProperty(WebProperty[] value) { 107 this.setValue(PROPERTY, value); 108 } 109 110 public WebProperty[] getWebProperty() { 112 return (WebProperty[])this.getValues(PROPERTY); 113 } 114 115 public int sizeWebProperty() { 117 return this.size(PROPERTY); 118 } 119 120 public int addWebProperty(com.sun.enterprise.tools.common.dd.webapp.WebProperty value) { 122 return this.addValue(PROPERTY, value); 123 } 124 125 public int removeWebProperty(com.sun.enterprise.tools.common.dd.webapp.WebProperty value) { 130 return this.removeValue(PROPERTY, value); 131 } 132 133 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 135 comparators.add(c); 136 } 137 138 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 140 comparators.remove(c); 141 } 142 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 143 boolean restrictionFailure = false; 144 if (getName() == null) { 146 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", "name", this); } 148 if (getClassName() == null) { 150 throw new org.netbeans.modules.schema2beans.ValidateException("getClassName() == null", "className", this); } 152 for (int _index = 0; _index < sizeWebProperty(); ++_index) { 154 com.sun.enterprise.tools.common.dd.webapp.WebProperty element = getWebProperty(_index); 155 if (element != null) { 156 element.validate(); 157 } 158 } 159 } 160 161 public void dump(StringBuffer str, String indent){ 163 String s; 164 Object o; 165 org.netbeans.modules.schema2beans.BaseBean n; 166 str.append(indent); 167 str.append("WebProperty["+this.sizeWebProperty()+"]"); for(int i=0; i<this.sizeWebProperty(); i++) 169 { 170 str.append(indent+"\t"); 171 str.append("#"+i+":"); 172 n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebProperty(i); 173 if (n != null) 174 n.dump(str, indent + "\t"); else 176 str.append(indent+"\tnull"); this.dumpAttributes(PROPERTY, i, str, indent); 178 } 179 180 } 181 public String dumpBeanNode(){ 182 StringBuffer str = new StringBuffer (); 183 str.append("CacheHelper\n"); this.dump(str, "\n "); return str.toString(); 186 }} 187 188 190 191 658 | Popular Tags |