KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > websphere6 > dd > beans > EjbExtensionsType


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

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 /**
26  *
27  * @author dlm198383
28  */

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         // Properties (see root bean comments for the bean graph)
43
initPropertyTables(2);
44         
45         this.createProperty(ENTERPRISE_BEAN_ID, // NOI18N
46
ENTERPRISE_BEAN,
47                 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
48                 java.lang.String JavaDoc.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, //NOI18N
58
LOCAL_TRANSACTION,
59                 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
60                 java.lang.String JavaDoc.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 JavaDoc value) {
86         this.setValue(ENTERPRISE_BEAN, value);
87     }
88     
89     public String JavaDoc getEnterpriseBean() {
90         return ( String JavaDoc)this.getValue(ENTERPRISE_BEAN);
91     }
92     
93     //
94
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
95         comparators.add(c);
96     }
97     
98     //
99
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
100         comparators.remove(c);
101     }
102     
103     public void setHref(java.lang.String JavaDoc value) {
104         setAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_HREF,DDXmi.addEjbJarHrefToId(value));
105         
106     }
107     
108     public String JavaDoc getHref() {
109         return DDXmi.getIdFromHref((String JavaDoc)getAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_HREF));
110     }
111     
112     public void setXmiType(java.lang.String JavaDoc value) {
113         setAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_TYPE,value);
114     }
115     
116     public String JavaDoc getXmiType() {
117         return (String JavaDoc)getAttributeValue(ENTERPRISE_BEAN, ENTERPRISE_BEAN_TYPE);
118     }
119     
120     public void setXmiId(String JavaDoc value) {
121         setAttributeValue(EJB_EXTENSIONS_XMI_ID,value);
122     }
123     
124     public String JavaDoc getXmiId(){
125         return (String JavaDoc)getAttributeValue(EJB_EXTENSIONS_XMI_ID);
126     }
127     
128     
129     public void setEjbExtensionsType(String JavaDoc value) {
130         setAttributeValue(EJB_EXTENSIONS_XMI_TYPE,value);
131     }
132     
133     public String JavaDoc getEjbExtensionsType(){
134         return (String JavaDoc)getAttributeValue(EJB_EXTENSIONS_XMI_TYPE);
135     }
136     public void setXmiName(String JavaDoc value) {
137         setAttributeValue(EJB_EXTENSIONS_XMI_NAME,value);
138     }
139     
140     public String JavaDoc getXmiName(){
141         return (String JavaDoc)getAttributeValue(EJB_EXTENSIONS_XMI_NAME);
142     }
143     
144     public String JavaDoc getLocalTransaction() {
145         return (String JavaDoc)this.getValue(LOCAL_TRANSACTION);
146     }
147     public void setLocalTransaction(String JavaDoc value) {
148         this.setValue(LOCAL_TRANSACTION,value);
149     }
150     
151     
152     public void setLocalTransactionXmiId(String JavaDoc value){
153         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID,value);
154     }
155     public String JavaDoc getLocalTransactionXmiId(){
156         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID);
157     }
158     
159     public void setLocalTransactionUnresolvedAction(String JavaDoc value){
160         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION,value);
161     }
162     public String JavaDoc getLocalTransactionUnresolvedAction(){
163         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION);
164     }
165     
166     public void setLocalTransactionResolver(String JavaDoc value){
167         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER,value);
168     }
169     public String JavaDoc getLocalTransactionResolver(){
170         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER);
171     }
172     
173      public void setLocalTransactionBoundary(String JavaDoc value){
174         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY,value);
175     }
176     public String JavaDoc getLocalTransactionBoundary(){
177         return (String JavaDoc)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); // NOI18N
186
}
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); // NOI18N
189
}
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); // NOI18N
192
}
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); // NOI18N
196
}
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); // NOI18N
199
}
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); // NOI18N
202
}
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); // NOI18N
206
if(getLocalTransactionUnresolvedAction()==null)
207                 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionUnresolvedAction() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); // NOI18N
208
}
209     }
210     // Dump the content of this bean returning it as a String
211
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
212         String JavaDoc s;
213         Object JavaDoc o;
214         org.netbeans.modules.schema2beans.BaseBean n;
215         str.append(indent);
216         str.append("EnterpriseBean"); // NOI18N
217
str.append(indent+"\t"); // NOI18N
218
str.append("<"); // NOI18N
219
o = this.getEnterpriseBean();
220         str.append((o==null?"null":o.toString().trim())); // NOI18N
221
str.append(">\n"); // NOI18N
222
this.dumpAttributes(ENTERPRISE_BEAN, 0, str, indent);
223         
224         
225     }
226     public String JavaDoc dumpBeanNode(){
227         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
228         str.append(getClass().getName()); // NOI18N
229
this.dump(str, "\n "); // NOI18N
230
return str.toString();
231     }
232 }
233
Popular Tags