1 19 20 package org.netbeans.modules.j2ee.sun.validation.constraints.data; 21 22 import org.w3c.dom.*; 23 import org.netbeans.modules.schema2beans.*; 24 import java.beans.*; 25 import java.util.*; 26 27 29 public class CheckInfo extends org.netbeans.modules.schema2beans.BaseBean 30 { 31 32 static Vector comparators = new Vector(); 33 34 static public final String NAME = "Name"; static public final String CLASSNAME = "Classname"; static public final String ARGUMENTS = "Arguments"; 38 public CheckInfo() { 39 this(Common.USE_DEFAULT_VALUES); 40 } 41 42 public CheckInfo(int options) 43 { 44 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 45 this.createProperty("name", NAME, 48 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 49 String .class); 50 this.createProperty("classname", CLASSNAME, 52 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 53 String .class); 54 this.createProperty("arguments", ARGUMENTS, 56 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 57 Arguments.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 setClassname(String value) { 79 this.setValue(CLASSNAME, value); 80 } 81 82 public String getClassname() { 84 return (String )this.getValue(CLASSNAME); 85 } 86 87 public void setArguments(Arguments value) { 89 this.setValue(ARGUMENTS, value); 90 } 91 92 public Arguments getArguments() { 94 return (Arguments)this.getValue(ARGUMENTS); 95 } 96 97 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 99 comparators.add(c); 100 } 101 102 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 104 comparators.remove(c); 105 } 106 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 107 boolean restrictionFailure = false; 108 if (getName() == null) { 110 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", "name", this); } 112 if (getClassname() == null) { 114 throw new org.netbeans.modules.schema2beans.ValidateException("getClassname() == null", "classname", this); } 116 if (getArguments() != null) { 118 getArguments().validate(); 119 } 120 } 121 122 public void dump(StringBuffer str, String indent){ 124 String s; 125 Object o; 126 org.netbeans.modules.schema2beans.BaseBean n; 127 str.append(indent); 128 str.append("Name"); str.append(indent+"\t"); str.append("<"); s = this.getName(); 132 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(NAME, 0, str, indent); 135 136 str.append(indent); 137 str.append("Classname"); str.append(indent+"\t"); str.append("<"); s = this.getClassname(); 141 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(CLASSNAME, 0, str, indent); 144 145 str.append(indent); 146 str.append("Arguments"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getArguments(); 148 if (n != null) 149 n.dump(str, indent + "\t"); else 151 str.append(indent+"\tnull"); this.dumpAttributes(ARGUMENTS, 0, str, indent); 153 154 } 155 public String dumpBeanNode(){ 156 StringBuffer str = new StringBuffer (); 157 str.append("CheckInfo\n"); this.dump(str, "\n "); return str.toString(); 160 }} 161 162 164 165 241 | Popular Tags |