1 23 24 29 30 package com.sun.enterprise.tools.common.dd.ejb; 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 CheckpointedMethods extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String DESCRIPTION = "Description"; static public final String METHOD = "Method"; 47 public CheckpointedMethods() { 48 this(Common.USE_DEFAULT_VALUES); 49 } 50 51 public CheckpointedMethods(int options) 52 { 53 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 54 this.createProperty("description", DESCRIPTION, 57 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 58 String .class); 59 this.createProperty("method", METHOD, 61 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 62 Method.class); 63 this.initialize(options); 64 } 65 66 void initialize(int options) 68 { 69 70 } 71 72 public void setDescription(String value) { 74 this.setValue(DESCRIPTION, value); 75 } 76 77 public String getDescription() { 79 return (String )this.getValue(DESCRIPTION); 80 } 81 82 public void setMethod(int index, Method value) { 84 this.setValue(METHOD, index, value); 85 } 86 87 public Method getMethod(int index) { 89 return (Method)this.getValue(METHOD, index); 90 } 91 92 public void setMethod(Method[] value) { 94 this.setValue(METHOD, value); 95 } 96 97 public Method[] getMethod() { 99 return (Method[])this.getValues(METHOD); 100 } 101 102 public int sizeMethod() { 104 return this.size(METHOD); 105 } 106 107 public int addMethod(com.sun.enterprise.tools.common.dd.ejb.Method value) { 109 return this.addValue(METHOD, value); 110 } 111 112 public int removeMethod(com.sun.enterprise.tools.common.dd.ejb.Method value) { 117 return this.removeValue(METHOD, value); 118 } 119 120 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 122 comparators.add(c); 123 } 124 125 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 127 comparators.remove(c); 128 } 129 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 130 boolean restrictionFailure = false; 131 if (getDescription() != null) { 133 } 134 if (sizeMethod() == 0) { 136 throw new org.netbeans.modules.schema2beans.ValidateException("sizeMethod() == 0", "method", this); } 138 for (int _index = 0; _index < sizeMethod(); ++_index) { 139 com.sun.enterprise.tools.common.dd.ejb.Method element = getMethod(_index); 140 if (element != null) { 141 element.validate(); 142 } 143 } 144 } 145 146 public void dump(StringBuffer str, String indent){ 148 String s; 149 Object o; 150 org.netbeans.modules.schema2beans.BaseBean n; 151 str.append(indent); 152 str.append("Description"); str.append(indent+"\t"); str.append("<"); s = this.getDescription(); 156 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(DESCRIPTION, 0, str, indent); 159 160 str.append(indent); 161 str.append("Method["+this.sizeMethod()+"]"); for(int i=0; i<this.sizeMethod(); i++) 163 { 164 str.append(indent+"\t"); 165 str.append("#"+i+":"); 166 n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethod(i); 167 if (n != null) 168 n.dump(str, indent + "\t"); else 170 str.append(indent+"\tnull"); this.dumpAttributes(METHOD, i, str, indent); 172 } 173 174 } 175 public String dumpBeanNode(){ 176 StringBuffer str = new StringBuffer (); 177 str.append("CheckpointedMethods\n"); this.dump(str, "\n "); return str.toString(); 180 }} 181 182 184 185 1029 | Popular Tags |