1 6 7 package com.sun.enterprise.tools.common.dd.ejb; 8 9 import org.w3c.dom.*; 10 import org.netbeans.modules.schema2beans.*; 11 import java.beans.*; 12 import java.util.*; 13 14 16 public class PmDescriptor extends com.sun.enterprise.tools.common.dd.SunBaseBean 17 { 18 19 static Vector comparators = new Vector(); 20 21 static public final String PM_IDENTIFIER = "PmIdentifier"; static public final String PM_VERSION = "PmVersion"; static public final String PM_CONFIG = "PmConfig"; static public final String PM_CLASS_GENERATOR = "PmClassGenerator"; static public final String PM_MAPPING_FACTORY = "PmMappingFactory"; 27 public PmDescriptor() { 28 this(Common.USE_DEFAULT_VALUES); 29 } 30 31 public PmDescriptor(int options) 32 { 33 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 34 this.createProperty("pm-identifier", PM_IDENTIFIER, 37 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 38 String .class); 39 this.createProperty("pm-version", PM_VERSION, 41 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 42 String .class); 43 this.createProperty("pm-config", PM_CONFIG, 45 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 46 String .class); 47 this.createProperty("pm-class-generator", PM_CLASS_GENERATOR, 49 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 50 String .class); 51 this.createProperty("pm-mapping-factory", PM_MAPPING_FACTORY, 53 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 54 String .class); 55 this.initialize(options); 56 } 57 58 void initialize(int options) 60 { 61 62 } 63 64 public void setPmIdentifier(String value) { 66 this.setValue(PM_IDENTIFIER, value); 67 } 68 69 public String getPmIdentifier() { 71 return (String )this.getValue(PM_IDENTIFIER); 72 } 73 74 public void setPmVersion(String value) { 76 this.setValue(PM_VERSION, value); 77 } 78 79 public String getPmVersion() { 81 return (String )this.getValue(PM_VERSION); 82 } 83 84 public void setPmConfig(String value) { 86 this.setValue(PM_CONFIG, value); 87 } 88 89 public String getPmConfig() { 91 return (String )this.getValue(PM_CONFIG); 92 } 93 94 public void setPmClassGenerator(String value) { 96 this.setValue(PM_CLASS_GENERATOR, value); 97 } 98 99 public String getPmClassGenerator() { 101 return (String )this.getValue(PM_CLASS_GENERATOR); 102 } 103 104 public void setPmMappingFactory(String value) { 106 this.setValue(PM_MAPPING_FACTORY, value); 107 } 108 109 public String getPmMappingFactory() { 111 return (String )this.getValue(PM_MAPPING_FACTORY); 112 } 113 114 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 116 comparators.add(c); 117 } 118 119 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 121 comparators.remove(c); 122 } 123 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 124 boolean restrictionFailure = false; 125 if (getPmIdentifier() == null) { 127 throw new org.netbeans.modules.schema2beans.ValidateException("getPmIdentifier() == null", "pmIdentifier", this); } 129 if (getPmVersion() == null) { 131 throw new org.netbeans.modules.schema2beans.ValidateException("getPmVersion() == null", "pmVersion", this); } 133 if (getPmConfig() != null) { 135 } 136 if (getPmClassGenerator() != null) { 138 } 139 if (getPmMappingFactory() != null) { 141 } 142 } 143 144 public void dump(StringBuffer str, String indent){ 146 String s; 147 Object o; 148 org.netbeans.modules.schema2beans.BaseBean n; 149 str.append(indent); 150 str.append("PmIdentifier"); str.append(indent+"\t"); str.append("<"); s = this.getPmIdentifier(); 154 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PM_IDENTIFIER, 0, str, indent); 157 158 str.append(indent); 159 str.append("PmVersion"); str.append(indent+"\t"); str.append("<"); s = this.getPmVersion(); 163 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PM_VERSION, 0, str, indent); 166 167 str.append(indent); 168 str.append("PmConfig"); str.append(indent+"\t"); str.append("<"); s = this.getPmConfig(); 172 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PM_CONFIG, 0, str, indent); 175 176 str.append(indent); 177 str.append("PmClassGenerator"); str.append(indent+"\t"); str.append("<"); s = this.getPmClassGenerator(); 181 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PM_CLASS_GENERATOR, 0, str, indent); 184 185 str.append(indent); 186 str.append("PmMappingFactory"); str.append(indent+"\t"); str.append("<"); s = this.getPmMappingFactory(); 190 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PM_MAPPING_FACTORY, 0, str, indent); 193 194 } 195 public String dumpBeanNode(){ 196 StringBuffer str = new StringBuffer (); 197 str.append("PmDescriptor\n"); this.dump(str, "\n "); return str.toString(); 200 }} 201 202 204 205 227 | Popular Tags |