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 ManagerProperties extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String PROPERTY = "WebProperty"; 46 public ManagerProperties() { 47 this(Common.USE_DEFAULT_VALUES); 48 } 49 50 public ManagerProperties(int options) 51 { 52 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 53 this.createProperty("property", PROPERTY, 56 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 57 WebProperty.class); 58 this.createAttribute(PROPERTY, "name", "Name", 59 AttrProp.CDATA | AttrProp.REQUIRED, 60 null, null); 61 this.createAttribute(PROPERTY, "value", "Value", 62 AttrProp.CDATA | AttrProp.REQUIRED, 63 null, null); 64 this.initialize(options); 65 } 66 67 void initialize(int options) 69 { 70 71 } 72 73 public void setWebProperty(int index, WebProperty value) { 75 this.setValue(PROPERTY, index, value); 76 } 77 78 public WebProperty getWebProperty(int index) { 80 return (WebProperty)this.getValue(PROPERTY, index); 81 } 82 83 public void setWebProperty(WebProperty[] value) { 85 this.setValue(PROPERTY, value); 86 } 87 88 public WebProperty[] getWebProperty() { 90 return (WebProperty[])this.getValues(PROPERTY); 91 } 92 93 public int sizeWebProperty() { 95 return this.size(PROPERTY); 96 } 97 98 public int addWebProperty(com.sun.enterprise.tools.common.dd.webapp.WebProperty value) { 100 return this.addValue(PROPERTY, value); 101 } 102 103 public int removeWebProperty(com.sun.enterprise.tools.common.dd.webapp.WebProperty value) { 108 return this.removeValue(PROPERTY, value); 109 } 110 111 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 113 comparators.add(c); 114 } 115 116 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 118 comparators.remove(c); 119 } 120 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 121 boolean restrictionFailure = false; 122 for (int _index = 0; _index < sizeWebProperty(); ++_index) { 124 com.sun.enterprise.tools.common.dd.webapp.WebProperty element = getWebProperty(_index); 125 if (element != null) { 126 element.validate(); 127 } 128 } 129 } 130 131 public void dump(StringBuffer str, String indent){ 133 String s; 134 Object o; 135 org.netbeans.modules.schema2beans.BaseBean n; 136 str.append(indent); 137 str.append("WebProperty["+this.sizeWebProperty()+"]"); for(int i=0; i<this.sizeWebProperty(); i++) 139 { 140 str.append(indent+"\t"); 141 str.append("#"+i+":"); 142 n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebProperty(i); 143 if (n != null) 144 n.dump(str, indent + "\t"); else 146 str.append(indent+"\tnull"); this.dumpAttributes(PROPERTY, i, str, indent); 148 } 149 150 } 151 public String dumpBeanNode(){ 152 StringBuffer str = new StringBuffer (); 153 str.append("ManagerProperties\n"); this.dump(str, "\n "); return str.toString(); 156 }} 157 158 160 161 628 | Popular Tags |