KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > MessageSecurity


1 /**
2  * This generated bean class MessageSecurity matches the schema element 'message-security'.
3  * The root bean class is SunEjbJar
4  *
5  * Generated on Tue Aug 08 09:56:25 PDT 2006
6  * @Generated
7  */

8
9 package com.sun.enterprise.tools.common.dd;
10
11 import org.w3c.dom.*;
12 import org.netbeans.modules.schema2beans.*;
13 import java.beans.*;
14 import java.util.*;
15
16 // BEGIN_NOI18N
17

18 public class MessageSecurity extends org.netbeans.modules.schema2beans.BaseBean
19 {
20
21     static Vector comparators = new Vector();
22     private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(5, 0, 0);
23
24     static public final String JavaDoc MESSAGE = "Message"; // NOI18N
25
static public final String JavaDoc REQUEST_PROTECTION = "RequestProtection"; // NOI18N
26
static public final String JavaDoc REQUESTPROTECTIONAUTHSOURCE = "RequestProtectionAuthSource"; // NOI18N
27
static public final String JavaDoc REQUESTPROTECTIONAUTHRECIPIENT = "RequestProtectionAuthRecipient"; // NOI18N
28
static public final String JavaDoc RESPONSE_PROTECTION = "ResponseProtection"; // NOI18N
29
static public final String JavaDoc RESPONSEPROTECTIONAUTHSOURCE = "ResponseProtectionAuthSource"; // NOI18N
30
static public final String JavaDoc RESPONSEPROTECTIONAUTHRECIPIENT = "ResponseProtectionAuthRecipient"; // NOI18N
31

32     public MessageSecurity() {
33         this(Common.USE_DEFAULT_VALUES);
34     }
35
36     public MessageSecurity(int options)
37     {
38         super(comparators, runtimeVersion);
39         // Properties (see root bean comments for the bean graph)
40
initPropertyTables(3);
41         this.createProperty("message", // NOI18N
42
MESSAGE,
43             Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
44             Message.class);
45         this.createProperty("request-protection", // NOI18N
46
REQUEST_PROTECTION,
47             Common.TYPE_0_1 | Common.TYPE_BOOLEAN | Common.TYPE_KEY,
48             Boolean JavaDoc.class);
49         this.createAttribute(REQUEST_PROTECTION, "auth-source", "AuthSource",
50                         AttrProp.ENUM | AttrProp.IMPLIED,
51                         new String JavaDoc[] {
52                             "sender",
53                             "content"
54                         }, null);
55         this.createAttribute(REQUEST_PROTECTION, "auth-recipient", "AuthRecipient",
56                         AttrProp.ENUM | AttrProp.IMPLIED,
57                         new String JavaDoc[] {
58                             "before-content",
59                             "after-content"
60                         }, null);
61         this.createProperty("response-protection", // NOI18N
62
RESPONSE_PROTECTION,
63             Common.TYPE_0_1 | Common.TYPE_BOOLEAN | Common.TYPE_KEY,
64             Boolean JavaDoc.class);
65         this.createAttribute(RESPONSE_PROTECTION, "auth-source", "AuthSource",
66                         AttrProp.ENUM | AttrProp.IMPLIED,
67                         new String JavaDoc[] {
68                             "sender",
69                             "content"
70                         }, null);
71         this.createAttribute(RESPONSE_PROTECTION, "auth-recipient", "AuthRecipient",
72                         AttrProp.ENUM | AttrProp.IMPLIED,
73                         new String JavaDoc[] {
74                             "before-content",
75                             "after-content"
76                         }, null);
77         this.initialize(options);
78     }
79
80     // Setting the default values of the properties
81
void initialize(int options) {
82
83     }
84
85     // This attribute is an array containing at least one element
86
public void setMessage(int index, Message value) {
87         this.setValue(MESSAGE, index, value);
88     }
89
90     //
91
public Message getMessage(int index) {
92         return (Message)this.getValue(MESSAGE, index);
93     }
94
95     // Return the number of properties
96
public int sizeMessage() {
97         return this.size(MESSAGE);
98     }
99
100     // This attribute is an array containing at least one element
101
public void setMessage(Message[] value) {
102         this.setValue(MESSAGE, value);
103     }
104
105     //
106
public Message[] getMessage() {
107         return (Message[])this.getValues(MESSAGE);
108     }
109
110     // Add a new element returning its index in the list
111
public int addMessage(com.sun.enterprise.tools.common.dd.Message value) {
112         int positionOfNewItem = this.addValue(MESSAGE, value);
113         return positionOfNewItem;
114     }
115
116     //
117
// Remove an element using its reference
118
// Returns the index the element had in the list
119
//
120
public int removeMessage(com.sun.enterprise.tools.common.dd.Message value) {
121         return this.removeValue(MESSAGE, value);
122     }
123
124     // This attribute is optional
125
public void setRequestProtection(boolean value) {
126         this.setValue(REQUEST_PROTECTION, (value ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE));
127     }
128
129     //
130
public boolean isRequestProtection() {
131         Boolean JavaDoc ret = (Boolean JavaDoc)this.getValue(REQUEST_PROTECTION);
132         if (ret == null)
133             ret = (Boolean JavaDoc)Common.defaultScalarValue(Common.TYPE_BOOLEAN);
134         return ((java.lang.Boolean JavaDoc)ret).booleanValue();
135     }
136
137     // This attribute is optional
138
public void setRequestProtectionAuthSource(java.lang.String JavaDoc value) {
139         // Make sure we've got a place to put this attribute.
140
if (size(REQUEST_PROTECTION) == 0) {
141             setValue(REQUEST_PROTECTION, java.lang.Boolean.TRUE);
142         }
143         setAttributeValue(REQUEST_PROTECTION, "AuthSource", value);
144     }
145
146     //
147
public java.lang.String JavaDoc getRequestProtectionAuthSource() {
148         // If our element does not exist, then the attribute does not exist.
149
if (size(REQUEST_PROTECTION) == 0) {
150             return null;
151         } else {
152             return getAttributeValue(REQUEST_PROTECTION, "AuthSource");
153         }
154     }
155
156     // This attribute is optional
157
public void setRequestProtectionAuthRecipient(java.lang.String JavaDoc value) {
158         // Make sure we've got a place to put this attribute.
159
if (size(REQUEST_PROTECTION) == 0) {
160             setValue(REQUEST_PROTECTION, java.lang.Boolean.TRUE);
161         }
162         setAttributeValue(REQUEST_PROTECTION, "AuthRecipient", value);
163     }
164
165     //
166
public java.lang.String JavaDoc getRequestProtectionAuthRecipient() {
167         // If our element does not exist, then the attribute does not exist.
168
if (size(REQUEST_PROTECTION) == 0) {
169             return null;
170         } else {
171             return getAttributeValue(REQUEST_PROTECTION, "AuthRecipient");
172         }
173     }
174
175     // This attribute is optional
176
public void setResponseProtection(boolean value) {
177         this.setValue(RESPONSE_PROTECTION, (value ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE));
178     }
179
180     //
181
public boolean isResponseProtection() {
182         Boolean JavaDoc ret = (Boolean JavaDoc)this.getValue(RESPONSE_PROTECTION);
183         if (ret == null)
184             ret = (Boolean JavaDoc)Common.defaultScalarValue(Common.TYPE_BOOLEAN);
185         return ((java.lang.Boolean JavaDoc)ret).booleanValue();
186     }
187
188     // This attribute is optional
189
public void setResponseProtectionAuthSource(java.lang.String JavaDoc value) {
190         // Make sure we've got a place to put this attribute.
191
if (size(RESPONSE_PROTECTION) == 0) {
192             setValue(RESPONSE_PROTECTION, java.lang.Boolean.TRUE);
193         }
194         setAttributeValue(RESPONSE_PROTECTION, "AuthSource", value);
195     }
196
197     //
198
public java.lang.String JavaDoc getResponseProtectionAuthSource() {
199         // If our element does not exist, then the attribute does not exist.
200
if (size(RESPONSE_PROTECTION) == 0) {
201             return null;
202         } else {
203             return getAttributeValue(RESPONSE_PROTECTION, "AuthSource");
204         }
205     }
206
207     // This attribute is optional
208
public void setResponseProtectionAuthRecipient(java.lang.String JavaDoc value) {
209         // Make sure we've got a place to put this attribute.
210
if (size(RESPONSE_PROTECTION) == 0) {
211             setValue(RESPONSE_PROTECTION, java.lang.Boolean.TRUE);
212         }
213         setAttributeValue(RESPONSE_PROTECTION, "AuthRecipient", value);
214     }
215
216     //
217
public java.lang.String JavaDoc getResponseProtectionAuthRecipient() {
218         // If our element does not exist, then the attribute does not exist.
219
if (size(RESPONSE_PROTECTION) == 0) {
220             return null;
221         } else {
222             return getAttributeValue(RESPONSE_PROTECTION, "AuthRecipient");
223         }
224     }
225
226     /**
227      * Create a new bean using it's default constructor.
228      * This does not add it to any bean graph.
229      */

230     public Message newMessage() {
231         return new Message();
232     }
233
234     //
235
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
236         comparators.add(c);
237     }
238
239     //
240
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
241         comparators.remove(c);
242     }
243     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
244     }
245
246     // Dump the content of this bean returning it as a String
247
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
248         String JavaDoc s;
249         Object JavaDoc o;
250         org.netbeans.modules.schema2beans.BaseBean n;
251         str.append(indent);
252         str.append("Message["+this.sizeMessage()+"]"); // NOI18N
253
for(int i=0; i<this.sizeMessage(); i++)
254         {
255             str.append(indent+"\t");
256             str.append("#"+i+":");
257             n = (org.netbeans.modules.schema2beans.BaseBean) this.getMessage(i);
258             if (n != null)
259                 n.dump(str, indent + "\t"); // NOI18N
260
else
261                 str.append(indent+"\tnull"); // NOI18N
262
this.dumpAttributes(MESSAGE, i, str, indent);
263         }
264
265         str.append(indent);
266         str.append("RequestProtection"); // NOI18N
267
str.append(indent+"\t"); // NOI18N
268
str.append((this.isRequestProtection()?"true":"false"));
269         this.dumpAttributes(REQUEST_PROTECTION, 0, str, indent);
270
271         str.append(indent);
272         str.append("ResponseProtection"); // NOI18N
273
str.append(indent+"\t"); // NOI18N
274
str.append((this.isResponseProtection()?"true":"false"));
275         this.dumpAttributes(RESPONSE_PROTECTION, 0, str, indent);
276
277     }
278     public String JavaDoc dumpBeanNode(){
279         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
280         str.append("MessageSecurity\n"); // NOI18N
281
this.dump(str, "\n "); // NOI18N
282
return str.toString();
283     }}
284
285 // END_NOI18N
286

287
Popular Tags