1 23 24 29 30 package com.sun.enterprise.tools.common.validation.samples.simple.beans; 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 ObjectFour extends org.netbeans.modules.schema2beans.BaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String PROPERTY_ONE = "PropertyOne"; static public final String PROPERTY_TWO = "PropertyTwo"; 47 public ObjectFour() { 48 this(Common.USE_DEFAULT_VALUES); 49 } 50 51 public ObjectFour(int options) 52 { 53 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 54 this.createProperty("property-one", PROPERTY_ONE, 57 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 58 String .class); 59 this.createProperty("property-two", PROPERTY_TWO, 61 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 62 String .class); 63 this.initialize(options); 64 } 65 66 void initialize(int options) 68 { 69 70 } 71 72 public void setPropertyOne(String value) { 74 this.setValue(PROPERTY_ONE, value); 75 } 76 77 public String getPropertyOne() { 79 return (String )this.getValue(PROPERTY_ONE); 80 } 81 82 public void setPropertyTwo(String value) { 84 this.setValue(PROPERTY_TWO, value); 85 } 86 87 public String getPropertyTwo() { 89 return (String )this.getValue(PROPERTY_TWO); 90 } 91 92 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 94 comparators.add(c); 95 } 96 97 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 99 comparators.remove(c); 100 } 101 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 102 boolean restrictionFailure = false; 103 if (getPropertyOne() != null) { 105 } 106 if (getPropertyTwo() != null) { 108 } 109 } 110 111 public void dump(StringBuffer str, String indent){ 113 String s; 114 Object o; 115 org.netbeans.modules.schema2beans.BaseBean n; 116 str.append(indent); 117 str.append("PropertyOne"); str.append(indent+"\t"); str.append("<"); s = this.getPropertyOne(); 121 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PROPERTY_ONE, 0, str, indent); 124 125 str.append(indent); 126 str.append("PropertyTwo"); str.append(indent+"\t"); str.append("<"); s = this.getPropertyTwo(); 130 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PROPERTY_TWO, 0, str, indent); 133 134 } 135 public String dumpBeanNode(){ 136 StringBuffer str = new StringBuffer (); 137 str.append("ObjectFour\n"); this.dump(str, "\n "); return str.toString(); 140 }} 141 142 144 145 238 | Popular Tags |