KickJava   Java API By Example, From Geeks To Geeks.

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


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 // BEGIN_NOI18N
27

28 public class AuthorizationTableType extends org.netbeans.modules.schema2beans.BaseBean implements DDXmiConstants {
29
30     static Vector comparators = new Vector();
31     static private final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0);
32     public AuthorizationTableType() {
33         this(Common.USE_DEFAULT_VALUES);
34     }
35     
36     public AuthorizationTableType(int options) {
37         super(comparators, runtimeVersion);
38         // Properties (see root bean comments for the bean graph)
39
initPropertyTables(1);
40         this.createProperty(AUTHORIZATIONS,
41                 AUTHORIZATION,
42                 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
43                 AuthorizationsType.class);
44         this.createAttribute(AUTHORIZATION, XMI_ID_ID, AUTH_ID,
45                 AttrProp.CDATA | AttrProp.IMPLIED,
46                 null, null);
47         this.initialize(options);
48     }
49     
50     // Setting the default values of the properties
51
void initialize(int options) {
52         
53     }
54     
55     // This attribute is an array, possibly empty
56
public void setAuthorization(int index, AuthorizationsType value) {
57         this.setValue(AUTHORIZATION, index, value);
58     }
59     
60     //
61
public AuthorizationsType getAuthorization(int index) {
62         return (AuthorizationsType)this.getValue(AUTHORIZATION, index);
63     }
64     
65     // Return the number of properties
66
public int sizeAuthorizations() {
67         return this.size(AUTHORIZATION);
68     }
69     
70     // This attribute is an array, possibly empty
71
public void setAuthorization(AuthorizationsType[] value) {
72         this.setValue(AUTHORIZATION, value);
73     }
74     
75     //
76
public AuthorizationsType[] getAuthorizations() {
77         return (AuthorizationsType[])this.getValues(AUTHORIZATION);
78     }
79     
80     // Add a new element returning its index in the list
81
public int addAuthorization(AuthorizationsType value) {
82         int positionOfNewItem = this.addValue(AUTHORIZATION, value);
83         return positionOfNewItem;
84     }
85     
86     //
87
// Remove an element using its reference
88
// Returns the index the element had in the list
89
//
90
public int removeAuthorization(AuthorizationsType value) {
91         return this.removeValue(AUTHORIZATION, value);
92     }
93     
94     /**
95      * Create a new bean using it's default constructor.
96      * This does not add it to any bean graph.
97      */

98     public AuthorizationsType newApplicationType() {
99         return new AuthorizationsType();
100     }
101     
102     
103     //
104
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
105         comparators.add(c);
106     }
107     
108     //
109
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
110         comparators.remove(c);
111     }
112     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
113         boolean restrictionFailure = false;
114         boolean restrictionPassed = false;
115         // Validating property parameter
116
for (int _index = 0; _index < sizeAuthorizations(); ++_index) {
117             AuthorizationsType element = getAuthorization(_index);
118             if (element != null) {
119                 element.validate();
120             }
121         }
122        
123     }
124     
125     // Dump the content of this bean returning it as a String
126
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
127         String JavaDoc s;
128         Object JavaDoc o;
129         org.netbeans.modules.schema2beans.BaseBean n;
130         str.append(indent);
131         str.append("Authorizations["+this.sizeAuthorizations()+"]"); // NOI18N
132
for(int i=0; i<this.sizeAuthorizations(); i++) {
133             str.append(indent+"\t");
134             str.append("#"+i+":");
135             n = (org.netbeans.modules.schema2beans.BaseBean) this.getAuthorization(i);
136             if (n != null)
137                 n.dump(str, indent + "\t"); // NOI18N
138
else
139                 str.append(indent+"\tnull"); // NOI18N
140
this.dumpAttributes(AUTHORIZATION, i, str, indent);
141         }
142         
143     }
144     public String JavaDoc dumpBeanNode(){
145         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
146         str.append(getClass().getName()); // NOI18N
147
this.dump(str, "\n "); // NOI18N
148
return str.toString();
149     }}
150
151 // END_NOI18N
152

153
Popular Tags