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 Argument 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 TYPE = "Type"; 37 public Argument() { 38 this(Common.USE_DEFAULT_VALUES); 39 } 40 41 public Argument(int options) 42 { 43 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 44 this.createProperty("name", NAME, 47 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 48 String .class); 49 this.createProperty("type", TYPE, 51 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 52 String .class); 53 this.initialize(options); 54 } 55 56 void initialize(int options) 58 { 59 60 } 61 62 public void setName(String value) { 64 this.setValue(NAME, value); 65 } 66 67 public String getName() { 69 return (String )this.getValue(NAME); 70 } 71 72 public void setType(String value) { 74 this.setValue(TYPE, value); 75 } 76 77 public String getType() { 79 return (String )this.getValue(TYPE); 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 (getName() == null) { 95 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", "name", this); } 97 if (getType() != null) { 99 } 100 } 101 102 public void dump(StringBuffer str, String indent){ 104 String s; 105 Object o; 106 org.netbeans.modules.schema2beans.BaseBean n; 107 str.append(indent); 108 str.append("Name"); str.append(indent+"\t"); str.append("<"); s = this.getName(); 112 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(NAME, 0, str, indent); 115 116 str.append(indent); 117 str.append("Type"); str.append(indent+"\t"); str.append("<"); s = this.getType(); 121 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(TYPE, 0, str, indent); 124 125 } 126 public String dumpBeanNode(){ 127 StringBuffer str = new StringBuffer (); 128 str.append("Argument\n"); this.dump(str, "\n "); return str.toString(); 131 }} 132 133 135 136 212 | Popular Tags |