1 19 20 24 25 package org.netbeans.modules.j2ee.sun.validation.data; 26 27 import org.w3c.dom.*; 28 import org.netbeans.modules.schema2beans.*; 29 import java.beans.*; 30 import java.util.*; 31 32 34 public class Check extends org.netbeans.modules.schema2beans.BaseBean 35 { 36 37 static Vector comparators = new Vector(); 38 39 static public final String NAME = "Name"; static public final String PARAMETERS = "Parameters"; 42 public Check() { 43 this(Common.USE_DEFAULT_VALUES); 44 } 45 46 public Check(int options) 47 { 48 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 49 this.createProperty("name", NAME, 52 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 53 String .class); 54 this.createProperty("parameters", PARAMETERS, 56 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 57 Parameters.class); 58 this.initialize(options); 59 } 60 61 void initialize(int options) 63 { 64 65 } 66 67 public void setName(String value) { 69 this.setValue(NAME, value); 70 } 71 72 public String getName() { 74 return (String )this.getValue(NAME); 75 } 76 77 public void setParameters(Parameters value) { 79 this.setValue(PARAMETERS, value); 80 } 81 82 public Parameters getParameters() { 84 return (Parameters)this.getValue(PARAMETERS); 85 } 86 87 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 89 comparators.add(c); 90 } 91 92 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 94 comparators.remove(c); 95 } 96 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 97 boolean restrictionFailure = false; 98 if (getName() == null) { 100 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", "name", this); } 102 if (getParameters() != null) { 104 getParameters().validate(); 105 } 106 } 107 108 public void dump(StringBuffer str, String indent){ 110 String s; 111 Object o; 112 org.netbeans.modules.schema2beans.BaseBean n; 113 str.append(indent); 114 str.append("Name"); str.append(indent+"\t"); str.append("<"); s = this.getName(); 118 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(NAME, 0, str, indent); 121 122 str.append(indent); 123 str.append("Parameters"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getParameters(); 125 if (n != null) 126 n.dump(str, indent + "\t"); else 128 str.append(indent+"\tnull"); this.dumpAttributes(PARAMETERS, 0, str, indent); 130 131 } 132 public String dumpBeanNode(){ 133 StringBuffer str = new StringBuffer (); 134 str.append("Check\n"); this.dump(str, "\n "); return str.toString(); 137 }} 138 139 141 142 219 | Popular Tags |