1 19 26 27 package org.netbeans.modules.j2ee.sun.dd.impl.transform; 28 29 import org.w3c.dom.*; 30 import org.netbeans.modules.schema2beans.*; 31 import java.beans.*; 32 import java.util.*; 33 34 36 public class ModAttribute extends org.netbeans.modules.schema2beans.BaseBean 37 { 38 39 static Vector comparators = new Vector(); 40 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 41 42 static public final String NAME = "Name"; 44 public ModAttribute() { 45 this(Common.USE_DEFAULT_VALUES); 46 } 47 48 public ModAttribute(int options) 49 { 50 super(comparators, runtimeVersion); 51 initPropertyTables(1); 53 this.createProperty("name", NAME, 55 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 56 String .class); 57 this.initialize(options); 58 } 59 60 void initialize(int options) { 62 63 } 64 65 public void setName(String value) { 67 this.setValue(NAME, value); 68 } 69 70 public String getName() { 72 return (String )this.getValue(NAME); 73 } 74 75 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 77 comparators.add(c); 78 } 79 80 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 82 comparators.remove(c); 83 } 84 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 85 boolean restrictionFailure = false; 86 boolean restrictionPassed = false; 87 if (getName() == null) { 89 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "name", this); } 91 } 92 93 public void dump(StringBuffer str, String indent){ 95 String s; 96 Object o; 97 org.netbeans.modules.schema2beans.BaseBean n; 98 str.append(indent); 99 str.append("Name"); str.append(indent+"\t"); str.append("<"); o = this.getName(); 103 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(NAME, 0, str, indent); 106 107 } 108 public String dumpBeanNode(){ 109 StringBuffer str = new StringBuffer (); 110 str.append("ModAttribute\n"); this.dump(str, "\n "); return str.toString(); 113 }} 114 115 117 118 143 | Popular Tags |