KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > runtime > connector > MapElement


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /**
25 * This generated bean class MapElement matches the DTD element map-element
26 *
27 * Generated on Mon May 13 13:36:49 PDT 2002
28 */

29
30 package com.sun.enterprise.deployment.runtime.connector;
31
32 import com.sun.enterprise.deployment.runtime.RuntimeDescriptor;
33
34 /**
35 * This class was based on the schema2beans generated one modified
36 * to remove its dependencies on schema2beans libraries.
37
38 * @author Jerome Dochez
39 * @version
40 */

41
42 public class MapElement extends RuntimeDescriptor
43 {
44     
45     static public final String JavaDoc PRINCIPAL = "Principal"; // NOI18N
46
static public final String JavaDoc BACKEND_PRINCIPAL = "BackendPrincipal"; // NOI18N
47

48     Principal backendPrincipal = null;
49     
50     // copy constructor
51
public MapElement(MapElement other)
52     {
53     super(other);
54     }
55
56     // constructor
57
public MapElement()
58     {
59     super();
60     }
61
62     // This attribute is an array containing at least one element
63
public void setPrincipal(int index, Principal value)
64     {
65     this.setValue(PRINCIPAL, index, value);
66     }
67     
68     //
69
public Principal getPrincipal(int index)
70     {
71     return (Principal)this.getValue(PRINCIPAL, index);
72     }
73     
74     // This attribute is an array containing at least one element
75
public void setPrincipal(Principal[] value)
76     {
77     this.setValue(PRINCIPAL, value);
78     }
79     
80     //
81
public Principal[] getPrincipal()
82     {
83     return (Principal[])this.getValues(PRINCIPAL);
84     }
85     
86     // Return the number of properties
87
public int sizePrincipal()
88     {
89     return this.size(PRINCIPAL);
90     }
91     
92     // Add a new element returning its index in the list
93
public int addPrincipal(Principal value)
94     {
95     return this.addValue(PRINCIPAL, value);
96     }
97     
98     //
99
// Remove an element using its reference
100
// Returns the index the element had in the list
101
//
102
public int removePrincipal(Principal value)
103     {
104     return this.removeValue(PRINCIPAL, value);
105     }
106     
107     // This attribute is mandatory
108
public void setBackendPrincipal(boolean value)
109     {
110     this.setValue(BACKEND_PRINCIPAL, new Boolean JavaDoc(value));
111     }
112     
113     //
114
public boolean isBackendPrincipal()
115     {
116     Boolean JavaDoc ret = (Boolean JavaDoc)this.getValue(BACKEND_PRINCIPAL);
117     if (ret == null)
118         return false;
119     return ret.booleanValue();
120     }
121     
122     // This method verifies that the mandatory properties are set
123
public boolean verify()
124     {
125     return true;
126     }
127 }
128
Popular Tags