KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_rar > deployment > xml > Adminobject


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  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: Eric Hardesty
23  * --------------------------------------------------------------------------
24  * $Id: Adminobject.java,v 1.1 2003/11/11 20:03:28 ehardesty Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_rar.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
31 /**
32  * This class defines the implementation of the element adminobject
33  *
34  * @author Eric Hardesty
35  */

36
37 public class Adminobject extends AbsElement {
38
39     /**
40      * id
41      */

42     private String JavaDoc id = null;
43
44     /**
45      * adminobject-interface
46      */

47     private String JavaDoc adminobjectInterface = null;
48
49     /**
50      * adminobject-class
51      */

52     private String JavaDoc adminobjectClass = null;
53
54     /**
55      * config-property
56      */

57     private JLinkedList configPropertyList = null;
58
59
60     /**
61      * Constructor
62      */

63     public Adminobject() {
64         super();
65         configPropertyList = new JLinkedList("config-property");
66     }
67
68     /**
69      * Gets the id
70      * @return the id
71      */

72     public String JavaDoc getId() {
73         return id;
74     }
75
76     /**
77      * Set the id
78      * @param id id object
79      */

80     public void setId(String JavaDoc id) {
81         this.id = id;
82     }
83
84     /**
85      * Gets the adminobject-interface
86      * @return the adminobject-interface
87      */

88     public String JavaDoc getAdminobjectInterface() {
89         return adminobjectInterface;
90     }
91
92     /**
93      * Set the adminobject-interface
94      * @param adminobjectInterface adminobjectInterface
95      */

96     public void setAdminobjectInterface(String JavaDoc adminobjectInterface) {
97         this.adminobjectInterface = adminobjectInterface;
98     }
99
100     /**
101      * Gets the adminobject-class
102      * @return the adminobject-class
103      */

104     public String JavaDoc getAdminobjectClass() {
105         return adminobjectClass;
106     }
107
108     /**
109      * Set the adminobject-class
110      * @param adminobjectClass adminobjectClass
111      */

112     public void setAdminobjectClass(String JavaDoc adminobjectClass) {
113         this.adminobjectClass = adminobjectClass;
114     }
115
116     /**
117      * Gets the config-property
118      * @return the config-property
119      */

120     public JLinkedList getConfigPropertyList() {
121         return configPropertyList;
122     }
123
124     /**
125      * Set the config-property
126      * @param configPropertyList configProperty
127      */

128     public void setConfigPropertyList(JLinkedList configPropertyList) {
129         this.configPropertyList = configPropertyList;
130     }
131
132     /**
133      * Add a new config-property element to this object
134      * @param configProperty the configPropertyobject
135      */

136     public void addConfigProperty(ConfigProperty configProperty) {
137         configPropertyList.add(configProperty);
138     }
139
140     /**
141      * Represents this element by it's XML description.
142      * @param indent use this indent for prefixing XML representation.
143      * @return the XML description of this object.
144      */

145     public String JavaDoc toXML(int indent) {
146         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
147         sb.append(indent(indent));
148         sb.append("<adminobject");
149         sb.append(xmlAttribute(id, "id"));
150         sb.append(">\n");
151
152         indent += 2;
153
154         // adminobject-interface
155
sb.append(xmlElement(adminobjectInterface, "adminobject-interface", indent));
156         // adminobject-class
157
sb.append(xmlElement(adminobjectClass, "adminobject-class", indent));
158         // config-property
159
sb.append(configPropertyList.toXML(indent));
160         indent -= 2;
161         sb.append(indent(indent));
162         sb.append("</adminobject>\n");
163
164         return sb.toString();
165     }
166 }
167
Popular Tags