1 6 7 package com.sun.enterprise.tools.common.dd.ejb; 8 9 import org.w3c.dom.*; 10 import org.netbeans.modules.schema2beans.*; 11 import java.beans.*; 12 import java.util.*; 13 14 16 public class FlushAtEndOfMethod extends com.sun.enterprise.tools.common.dd.SunBaseBean 17 { 18 19 static Vector comparators = new Vector(); 20 21 static public final String METHOD = "Method"; 23 public FlushAtEndOfMethod() { 24 this(Common.USE_DEFAULT_VALUES); 25 } 26 27 public FlushAtEndOfMethod(int options) 28 { 29 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 30 this.createProperty("method", METHOD, 33 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 34 Method.class); 35 this.initialize(options); 36 } 37 38 void initialize(int options) 40 { 41 42 } 43 44 public void setMethod(int index, Method value) { 46 this.setValue(METHOD, index, value); 47 } 48 49 public Method getMethod(int index) { 51 return (Method)this.getValue(METHOD, index); 52 } 53 54 public void setMethod(Method[] value) { 56 this.setValue(METHOD, value); 57 } 58 59 public Method[] getMethod() { 61 return (Method[])this.getValues(METHOD); 62 } 63 64 public int sizeMethod() { 66 return this.size(METHOD); 67 } 68 69 public int addMethod(com.sun.enterprise.tools.common.dd.ejb.Method value) { 71 return this.addValue(METHOD, value); 72 } 73 74 public int removeMethod(com.sun.enterprise.tools.common.dd.ejb.Method value) { 79 return this.removeValue(METHOD, value); 80 } 81 82 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 84 comparators.add(c); 85 } 86 87 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 89 comparators.remove(c); 90 } 91 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 92 boolean restrictionFailure = false; 93 if (sizeMethod() == 0) { 95 throw new org.netbeans.modules.schema2beans.ValidateException("sizeMethod() == 0", "method", this); } 97 for (int _index = 0; _index < sizeMethod(); ++_index) { 98 com.sun.enterprise.tools.common.dd.ejb.Method element = getMethod(_index); 99 if (element != null) { 100 element.validate(); 101 } 102 } 103 } 104 105 public void dump(StringBuffer str, String indent){ 107 String s; 108 Object o; 109 org.netbeans.modules.schema2beans.BaseBean n; 110 str.append(indent); 111 str.append("Method["+this.sizeMethod()+"]"); for(int i=0; i<this.sizeMethod(); i++) 113 { 114 str.append(indent+"\t"); 115 str.append("#"+i+":"); 116 n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethod(i); 117 if (n != null) 118 n.dump(str, indent + "\t"); else 120 str.append(indent+"\tnull"); this.dumpAttributes(METHOD, i, str, indent); 122 } 123 124 } 125 public String dumpBeanNode(){ 126 StringBuffer str = new StringBuffer (); 127 str.append("FlushAtEndOfMethod\n"); this.dump(str, "\n "); return str.toString(); 130 }} 131 132 134 135 157 | Popular Tags |