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 Cmp extends com.sun.enterprise.tools.common.dd.SunBaseBean 17 { 18 19 static Vector comparators = new Vector(); 20 21 static public final String MAPPING_PROPERTIES = "MappingProperties"; static public final String IS_ONE_ONE_CMP = "IsOneOneCmp"; static public final String ONE_ONE_FINDERS = "OneOneFinders"; static public final String PREFETCH_DISABLED = "PrefetchDisabled"; 26 public Cmp() { 27 this(Common.USE_DEFAULT_VALUES); 28 } 29 30 public Cmp(int options) 31 { 32 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 33 this.createProperty("mapping-properties", MAPPING_PROPERTIES, 36 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 37 String .class); 38 this.createProperty("is-one-one-cmp", IS_ONE_ONE_CMP, 40 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 41 String .class); 42 this.createProperty("one-one-finders", ONE_ONE_FINDERS, 44 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 45 OneOneFinders.class); 46 this.createProperty("prefetch-disabled", PREFETCH_DISABLED, 48 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 49 PrefetchDisabled.class); 50 this.initialize(options); 51 } 52 53 void initialize(int options) 55 { 56 57 } 58 59 public void setMappingProperties(String value) { 61 this.setValue(MAPPING_PROPERTIES, value); 62 } 63 64 public String getMappingProperties() { 66 return (String )this.getValue(MAPPING_PROPERTIES); 67 } 68 69 public void setIsOneOneCmp(String value) { 71 this.setValue(IS_ONE_ONE_CMP, value); 72 } 73 74 public String getIsOneOneCmp() { 76 return (String )this.getValue(IS_ONE_ONE_CMP); 77 } 78 79 public void setOneOneFinders(OneOneFinders value) { 81 this.setValue(ONE_ONE_FINDERS, value); 82 } 83 84 public OneOneFinders getOneOneFinders() { 86 return (OneOneFinders)this.getValue(ONE_ONE_FINDERS); 87 } 88 89 public void setPrefetchDisabled(PrefetchDisabled value) { 91 this.setValue(PREFETCH_DISABLED, value); 92 } 93 94 public PrefetchDisabled getPrefetchDisabled() { 96 return (PrefetchDisabled)this.getValue(PREFETCH_DISABLED); 97 } 98 99 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 101 comparators.add(c); 102 } 103 104 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 106 comparators.remove(c); 107 } 108 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 109 boolean restrictionFailure = false; 110 if (getMappingProperties() != null) { 112 } 113 if (getIsOneOneCmp() != null) { 115 } 116 if (getOneOneFinders() != null) { 118 getOneOneFinders().validate(); 119 } 120 if (getPrefetchDisabled() != null) { 122 getPrefetchDisabled().validate(); 123 } 124 } 125 126 public void dump(StringBuffer str, String indent){ 128 String s; 129 Object o; 130 org.netbeans.modules.schema2beans.BaseBean n; 131 str.append(indent); 132 str.append("MappingProperties"); str.append(indent+"\t"); str.append("<"); s = this.getMappingProperties(); 136 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(MAPPING_PROPERTIES, 0, str, indent); 139 140 str.append(indent); 141 str.append("IsOneOneCmp"); str.append(indent+"\t"); str.append("<"); s = this.getIsOneOneCmp(); 145 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(IS_ONE_ONE_CMP, 0, str, indent); 148 149 str.append(indent); 150 str.append("OneOneFinders"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getOneOneFinders(); 152 if (n != null) 153 n.dump(str, indent + "\t"); else 155 str.append(indent+"\tnull"); this.dumpAttributes(ONE_ONE_FINDERS, 0, str, indent); 157 158 str.append(indent); 159 str.append("PrefetchDisabled"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getPrefetchDisabled(); 161 if (n != null) 162 n.dump(str, indent + "\t"); else 164 str.append(indent+"\tnull"); this.dumpAttributes(PREFETCH_DISABLED, 0, str, indent); 166 167 } 168 public String dumpBeanNode(){ 169 StringBuffer str = new StringBuffer (); 170 str.append("Cmp\n"); this.dump(str, "\n "); return str.toString(); 173 }} 174 175 177 178 200 | Popular Tags |