KickJava   Java API By Example, From Geeks To Geeks.

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


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 ExtendedServletsType 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     static public final String JavaDoc EXTENDED_SERVLET_HREF="ExtendedServletHref";
35     
36     /**
37      * Creates a new instance of ExtendedServletExtensionsType
38      */

39     public ExtendedServletsType() {
40         this(Common.USE_DEFAULT_VALUES);
41     }
42     public ExtendedServletsType(int options) {
43         super(comparators, runtimeVersion);
44         // Properties (see root bean comments for the bean graph)
45
initPropertyTables(3);
46         this.createProperty(EXTENDED_SERVLET_ID,
47                 EXTENDED_SERVLET,
48                 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
49                 java.lang.String JavaDoc.class);
50         
51         this.createAttribute(EXTENDED_SERVLET, HREF_ID, EXTENDED_SERVLET_HREF,
52                 AttrProp.CDATA | AttrProp.IMPLIED,
53                 null, null);
54         
55         
56         
57         this.createProperty(MARKUP_LANGUAGES_ID,
58                 MARKUP_LANGUAGES,
59                 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
60                 MarkupLanguagesType.class);
61         
62         this.createAttribute(MARKUP_LANGUAGES,XMI_ID_ID,MARKUP_LANGUAGES_XMI_ID,
63                 AttrProp.CDATA | AttrProp.IMPLIED,
64                 null, null);
65         
66         this.createAttribute(MARKUP_LANGUAGES,NAME_ID,MARKUP_LANGUAGES_NAME,
67                 AttrProp.CDATA | AttrProp.IMPLIED,
68                 null, null);
69         this.createAttribute(MARKUP_LANGUAGES,MIME_TYPE_ID,MARKUP_LANGUAGES_MIME_TYPE,
70                 AttrProp.CDATA | AttrProp.IMPLIED,
71                 null, null);
72         this.createAttribute(MARKUP_LANGUAGES,ERROR_PAGE_ID,MARKUP_LANGUAGES_ERROR_PAGE,
73                 AttrProp.CDATA | AttrProp.IMPLIED,
74                 null, null);
75         this.createAttribute(MARKUP_LANGUAGES,DEFAULT_PAGE_ID,MARKUP_LANGUAGES_DEFAULT_PAGE ,
76                 AttrProp.CDATA | AttrProp.IMPLIED,
77                 null, null);
78         
79         
80         this.createProperty(LOCAL_TRANSACTION_ID,
81                 LOCAL_TRANSACTION,
82                 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
83                 java.lang.String JavaDoc.class);
84         this.createAttribute(LOCAL_TRANSACTION, XMI_ID_ID, LOCAL_TRANSACTION_XMI_ID,
85                 AttrProp.CDATA | AttrProp.IMPLIED,
86                 null, null);
87         this.createAttribute(LOCAL_TRANSACTION,UNRESOLVED_ACTION_ID,LOCAL_TRANSACTION_UNRESOLVED_ACTION,
88                 AttrProp.CDATA | AttrProp.IMPLIED,
89                 null, null);
90         this.createAttribute(LOCAL_TRANSACTION,BOUNDARY_ID,LOCAL_TRANSACTION_BOUNDARY,
91                 AttrProp.CDATA | AttrProp.IMPLIED,
92                 null, null);
93         this.createAttribute(LOCAL_TRANSACTION,RESOLVER_ID,LOCAL_TRANSACTION_RESOLVER,
94                 AttrProp.CDATA | AttrProp.IMPLIED,
95                 null, null);
96         
97         this.initialize(options);
98     }
99     public void initialize(int options) {
100         
101     }
102     public void setDefaults() {
103         setHref("");
104     }
105     public void setExtendedServlet(String JavaDoc value) {
106         this.setValue(EXTENDED_SERVLET, value);
107     }
108     
109     public String JavaDoc getExtendedServlet() {
110         return ( String JavaDoc)this.getValue(EXTENDED_SERVLET);
111     }
112     
113     public void setXmiId(String JavaDoc value) {
114         setAttributeValue(EXTENDED_SERVLETS_XMI_ID,value);
115     }
116     
117     public String JavaDoc getXmiId(){
118         return (String JavaDoc)getAttributeValue(EXTENDED_SERVLETS_XMI_ID);
119     }
120     
121     //
122
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
123         comparators.add(c);
124     }
125     
126     //
127
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
128         comparators.remove(c);
129     }
130     
131     public void setHref(java.lang.String JavaDoc value) {
132         setAttributeValue(EXTENDED_SERVLET, EXTENDED_SERVLET_HREF,DDXmi.addWebHrefToId(value));
133     }
134     
135     public String JavaDoc getHref() {
136         return DDXmi.getIdFromHref((String JavaDoc)getAttributeValue(EXTENDED_SERVLET, EXTENDED_SERVLET_HREF));
137     }
138     
139     public String JavaDoc getLocalTransaction() {
140         return (String JavaDoc)this.getValue(LOCAL_TRANSACTION);
141     }
142     public void setLocalTransaction(String JavaDoc value) {
143         this.setValue(LOCAL_TRANSACTION,value);
144     }
145     
146     
147     public void setLocalTransactionXmiId(String JavaDoc value){
148         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID,value);
149     }
150     public String JavaDoc getLocalTransactionXmiId(){
151         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_XMI_ID);
152     }
153     
154     public void setLocalTransactionUnresolvedAction(String JavaDoc value){
155         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION,value);
156     }
157     public String JavaDoc getLocalTransactionUnresolvedAction(){
158         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_UNRESOLVED_ACTION);
159     }
160     
161     public void setLocalTransactionResolver(String JavaDoc value){
162         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER,value);
163     }
164     public String JavaDoc getLocalTransactionResolver(){
165         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_RESOLVER);
166     }
167     
168      public void setLocalTransactionBoundary(String JavaDoc value){
169         this.setAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY,value);
170     }
171     public String JavaDoc getLocalTransactionBoundary(){
172         return (String JavaDoc)this.getAttributeValue(LOCAL_TRANSACTION, LOCAL_TRANSACTION_BOUNDARY);
173     }
174     
175     public MarkupLanguagesType [] getMarkupLanguages() {
176         return (MarkupLanguagesType [])this.getValues(MARKUP_LANGUAGES);
177     }
178     public MarkupLanguagesType getMarkupLanguages(int index) {
179         return (MarkupLanguagesType)this.getValue(MARKUP_LANGUAGES,index);
180     }
181     public void setMarkupLanguages(int index,MarkupLanguagesType value) {
182         this.setValue(MARKUP_LANGUAGES,index,value);
183     }
184     
185     
186     
187     public int sizeMarkupLanguages() {
188         return this.size(MARKUP_LANGUAGES);
189     }
190     public int addMarkupLanguages(MarkupLanguagesType value) {
191         int positionOfNewItem = this.addValue(MARKUP_LANGUAGES, value);
192         return positionOfNewItem;
193     }
194     
195     public int removeMarkupLanguages(MarkupLanguagesType value) {
196         return this.removeValue(MARKUP_LANGUAGES, value);
197     }
198     
199     
200     
201     
202     
203     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
204         
205         if(getExtendedServlet()==null) {
206             throw new org.netbeans.modules.schema2beans.ValidateException("getExtendedServlet() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); // NOI18N
207
}
208         if(getXmiId()==null) {
209             throw new org.netbeans.modules.schema2beans.ValidateException("getExtendedServletsId == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); // NOI18N
210
}
211         if(getHref()==null) {
212             throw new org.netbeans.modules.schema2beans.ValidateException("getHref() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE,EXTENDED_SERVLETS, this); // NOI18N
213
}
214         if(getLocalTransaction()!=null) {
215             if(getLocalTransactionXmiId()==null)
216                 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionXmiId() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); // NOI18N
217
if(getLocalTransactionUnresolvedAction()==null)
218                 throw new org.netbeans.modules.schema2beans.ValidateException("getLocalTransactionUnresolvedAction() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, EXTENDED_SERVLETS, this); // NOI18N
219
}
220         int size=sizeMarkupLanguages();
221         for(int i=0;i<size;i++) {
222             getMarkupLanguages(i).validate();
223         }
224     }
225     // Dump the content of this bean returning it as a String
226
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
227         String JavaDoc s;
228         Object JavaDoc o;
229         org.netbeans.modules.schema2beans.BaseBean n;
230         str.append(indent);
231         str.append("ExtendedServlet"); // NOI18N
232
str.append(indent+"\t"); // NOI18N
233
str.append("<"); // NOI18N
234
o = this.getExtendedServlet();
235         str.append((o==null?"null":o.toString().trim())); // NOI18N
236
str.append(">\n"); // NOI18N
237
this.dumpAttributes(EXTENDED_SERVLET, 0, str, indent);
238         
239         
240     }
241     public String JavaDoc dumpBeanNode(){
242         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
243         str.append(getClass().getName()); // NOI18N
244
this.dump(str, "\n "); // NOI18N
245
return str.toString();
246     }
247 }
248
Popular Tags