1 19 package org.netbeans.modules.j2ee.websphere6.dd.beans; 20 21 import org.w3c.dom.*; 22 import org.netbeans.modules.schema2beans.*; 23 import java.beans.*; 24 import java.util.*; 25 29 public class EjbExtensionsType extends org.netbeans.modules.schema2beans.BaseBean implements DDXmiConstants { 30 31 static Vector comparators = new Vector(); 32 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 33 34 35 36 37 public EjbExtensionsType() { 38 this(Common.USE_DEFAULT_VALUES); 39 } 40 public EjbExtensionsType(int options) { 41 super(comparators, runtimeVersion); 42 initPropertyTables(2); 44 45 this.createProperty(ENTERPRISE_BEAN_ID, ENTERPRISE_BEAN, 47 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 48 java.lang.String .class); 49 50 this.createAttribute(ENTERPRISE_BEAN, HREF_ID, ENTERPRISE_BEAN_HREF, 51 AttrProp.CDATA | AttrProp.IMPLIED, 52 null, null); 53 this.createAttribute(ENTERPRISE_BEAN, XMI_TYPE_ID, ENTERPRISE_BEAN_TYPE, 54 AttrProp.CDATA | AttrProp.IMPLIED, 55 null, null); 56 57 this.createProperty(LOCAL_TRANSACTION_ID, LOCAL_TRANSACTION, 59 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 60 java.lang.String .class); 61 this.createAttribute(LOCAL_TRANSACTION, XMI_ID_ID, LOCAL_TRANSACTION_XMI_ID, 62 AttrProp.CDATA | AttrProp.IMPLIED, 63 null, null); 64 this.createAttribute(LOCAL_TRANSACTION,UNRESOLVED_ACTION_ID,LOCAL_TRANSACTION_UNRESOLVED_ACTION, 65 AttrProp.CDATA | AttrProp.IMPLIED, 66 null, null); 67 this.createAttribute(LOCAL_TRANSACTION,BOUNDARY_ID,LOCAL_TRANSACTION_BOUNDARY, 68 AttrProp.CDATA | AttrProp.IMPLIED, 69 null, null); 70 this.createAttribute(LOCAL_TRANSACTION,RESOLVER_ID,LOCAL_TRANSACTION_RESOLVER, 71 AttrProp.CDATA | AttrProp.IMPLIED, 72 null, null); 73 74 75 this.initialize(options); 76 } 77 public void initialize(int options) { 78 79 } 80 public void setDefaults(){ 81 setEnterpriseBean(""); 82 setHref(""); 83 } 84 85 public void setEnterpriseBean(String value) { 86 this.setValue(ENTERPRISE_BEAN, value); 87 } 88 89 public String getEnterpriseBean() { 90 return ( String )this.getValue(ENTERPRISE_BEAN); 91 } 92 93 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 95 comparators.add(c); 96 } 97 98 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 100 comparators.remove(c); 101 } 102 103 public void setHref(java.lang.String value) { 104 setAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_HREF,DDXmi.addEjbJarHrefToId(value)); 105 106 } 107 108 public String getHref() { 109 return DDXmi.getIdFromHref((String )getAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_HREF)); 110 } 111 112 public void setXmiType(java.lang.String value) { 113 setAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_TYPE,value); 114 } 115 116 public String getXmiType() { 117 return (String )getAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_TYPE); 118 } 119 120 public void setXmiId(String value) { 121 setAttributeValue(EJB_EXTENSIONS_XMI_ID,value); 122 } 123 124 public String getXmiId(){ 125 return (String )getAttributeValue(EJB_EXTENSIONS_XMI_ID); 126 } 127 128 129 public void setEjbExtensionsType(String value) { 130 setAttributeValue(EJB_EXTENSIONS_XMI_TYPE,value); 131 } 132 133 public String getEjbExtensionsType(){ 134 return (String )getAttributeValue(EJB_EXTENSIONS_XMI_TYPE); 135 } 136 public void setXmiName(String value) { 137 setAttributeValue(EJB_EXTENSIONS_XMI_NAME,value); 138 } 139 140 public String getXmiName(){ 141 return (String )getAttributeValue(EJB_EXTENSIONS_XMI_NAME); 142 } 143 144 public String getLocalTransaction() { 145 return (String )this.getValue(LOCAL_TRANSACTION); 146 } 147 public void setLocalTransaction(String value) { 148 this.setValue(LOCAL_TRANSACTION,value); 149 } 150 151 152 public void setLocalTransactionXmiId(String value){ 153 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID,value); 154 } 155 public String getLocalTransactionXmiId(){ 156 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID); 157 } 158 159 public void setLocalTransactionUnresolvedAction(String value){ 160 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION,value); 161 } 162 public String getLocalTransactionUnresolvedAction(){ 163 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION); 164 } 165 166 public void setLocalTransactionResolver(String value){ 167 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER,value); 168 } 169 public String getLocalTransactionResolver(){ 170 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER); 171 } 172 173 public void setLocalTransactionBoundary(String value){ 174 this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY,value); 175 } 176 public String getLocalTransactionBoundary(){ 177 return (String )this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY); 178 } 179 180 181 182 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 183 184 if(getEnterpriseBean()==null) { 185 throw new org.netbeans.modules.schema2beans.ValidateException("getEnterpriseBean() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, ENTERPRISE_BEAN, this); } 187 if(getHref()==null) { 188 throw new org.netbeans.modules.schema2beans.ValidateException("getHref() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, ENTERPRISE_BEAN, this); } 190 if(getXmiType()==null) { 191 throw new org.netbeans.modules.schema2beans.ValidateException("getXmiType() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, ENTERPRISE_BEAN, this); } 193 194 if(getXmiId()==null) { 195 throw new org.netbeans.modules.schema2beans.ValidateException("getXmiId == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EJB_EXTENSIONS, this); } 197 if(getXmiName()==null) { 198 throw new org.netbeans.modules.schema2beans.ValidateException("getXmiName == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EJB_EXTENSIONS, this); } 200 if(getEjbExtensionsType()==null) { 201 throw new org.netbeans.modules.schema2beans.ValidateException("getEjbExtensionsType == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EJB_EXTENSIONS, this); } 203 if(getLocalTransaction()!=null) { 204 if(getLocalTransactionXmiId()==null) 205 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionXmiId() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); if(getLocalTransactionUnresolvedAction()==null) 207 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionUnresolvedAction() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); } 209 } 210 public void dump(StringBuffer str, String indent){ 212 String s; 213 Object o; 214 org.netbeans.modules.schema2beans.BaseBean n; 215 str.append(indent); 216 str.append("EnterpriseBean"); str.append(indent+"\t"); str.append("<"); o = this.getEnterpriseBean(); 220 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(ENTERPRISE_BEAN, 0, str, indent); 223 224 225 } 226 public String dumpBeanNode(){ 227 StringBuffer str = new StringBuffer (); 228 str.append(getClass().getName()); this.dump(str, "\n "); return str.toString(); 231 } 232 } 233 | Popular Tags |