KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_lib > deployment > xml > EjbLocalRef


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Florent BENOIT
22  * --------------------------------------------------------------------------
23  * $Id: EjbLocalRef.java,v 1.2 2004/05/10 12:04:39 sauthieg Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package org.objectweb.jonas_lib.deployment.xml;
28
29 /**
30  * This class defines the implementation of the element ejb-local-ref.
31  * @author Florent Benoit
32  */

33 public class EjbLocalRef extends AbsElement {
34
35     /**
36      * Description of the ejb-local-ref
37      */

38     private String JavaDoc description = null;
39
40     /**
41      * Name of this ejb-local-ref
42      */

43     private String JavaDoc ejbRefName = null;
44
45     /**
46      * Type of this ejb-local-ref
47      */

48     private String JavaDoc ejbRefType = null;
49
50     /**
51      * Local Home of this ejb-local-ref
52      */

53     private String JavaDoc localHome = null;
54
55     /**
56      * Local interface of this ejb-local-ref
57      */

58     private String JavaDoc local = null;
59
60     /**
61      * ejb-link of this ejb-local-ref
62      */

63     private String JavaDoc ejbLink = null;
64
65
66     // Setters
67

68     /**
69      * Sets the description
70      * @param description the description to use
71      */

72     public void setDescription(String JavaDoc description) {
73         this.description = description;
74     }
75
76
77     /**
78      * Sets the name
79      * @param ejbRefName the name to use
80      */

81     public void setEjbRefName(String JavaDoc ejbRefName) {
82         this.ejbRefName = ejbRefName;
83     }
84
85
86     /**
87      * Sets the type
88      * @param ejbRefType the type to use
89      */

90     public void setEjbRefType(String JavaDoc ejbRefType) {
91         this.ejbRefType = ejbRefType;
92     }
93
94
95     /**
96      * Sets the local home interface
97      * @param localHome the local home interface to use
98      */

99     public void setLocalHome(String JavaDoc localHome) {
100         this.localHome = localHome;
101     }
102     /**
103      * Sets the local interface
104      * @param local the local interface to use
105      */

106     public void setLocal(String JavaDoc local) {
107         this.local = local;
108     }
109
110
111     /**
112      * Sets the ejb-link
113      * @param ejbLink the ejb-link to use
114      */

115     public void setEjbLink(String JavaDoc ejbLink) {
116         this.ejbLink = ejbLink;
117     }
118
119
120     // Getters
121

122     /**
123      * @return the description of the ejb-local-ref
124      */

125     public String JavaDoc getDescription() {
126         return description;
127     }
128
129
130     /**
131      * @return the name of the ejb-local-ref
132      */

133     public String JavaDoc getEjbRefName() {
134         return ejbRefName;
135     }
136
137
138     /**
139      * @return the type of the ejb-local-ref
140      */

141     public String JavaDoc getEjbRefType() {
142         return ejbRefType;
143     }
144
145     /**
146      * @return the local home interface of the ejb-local-ref
147      */

148     public String JavaDoc getLocalHome() {
149         return localHome;
150     }
151
152     /**
153      * @return the local interface of the ejb-local-ref
154      */

155     public String JavaDoc getLocal() {
156         return local;
157     }
158
159     /**
160      * @return the ejb-link of the ejb-local-ref
161      */

162     public String JavaDoc getEjbLink() {
163         return ejbLink;
164     }
165
166
167
168
169
170     /**
171      * Represents this element by it's XML description.
172      * @param indent use this indent for prexifing XML representation.
173      * @return the XML description of this object.
174      */

175     public String JavaDoc toXML(int indent) {
176         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
177         sb.append(indent(indent));
178         sb.append("<ejb-local-ref>\n");
179
180         indent += 2;
181
182         // Description
183
sb.append(xmlElement(description, "description", indent));
184
185         // name
186
sb.append(xmlElement(ejbRefName, "ejb-ref-name", indent));
187
188         // type
189
sb.append(xmlElement(ejbRefType, "ejb-ref-type", indent));
190
191         // local home interface
192
sb.append(xmlElement(localHome, "local-home", indent));
193
194         // local interface
195
sb.append(xmlElement(local, "local", indent));
196
197         // ejb-link
198
sb.append(xmlElement(ejbLink, "ejb-link", indent));
199
200         indent -= 2;
201         sb.append(indent(indent));
202         sb.append("</ejb-local-ref>\n");
203
204         return sb.toString();
205     }
206
207
208 }
209
Popular Tags