001: /**
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: *
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or 1any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
020: * USA
021: *
022: * Initial developer: Eric Hardesty
023: * --------------------------------------------------------------------------
024: * $Id: JonasActivationspec.java 5144 2004-07-19 16:31:59Z ehardesty $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_rar.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030: import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
031:
032: /**
033: * This class defines the implementation of the element jonas-activationspec
034: *
035: * @author Eric Hardesty
036: */
037:
038: public class JonasActivationspec extends AbsElement implements
039: TopLevelElement {
040:
041: /**
042: * id
043: */
044: private String id = null;
045:
046: /**
047: * description
048: */
049: private JLinkedList descriptionList = null;
050:
051: /**
052: * jndi-name
053: */
054: private String jndiName = null;
055:
056: /**
057: * defaultAS
058: */
059: private String defaultAS = null;
060:
061: /**
062: * Constructor
063: */
064: public JonasActivationspec() {
065: super ();
066: descriptionList = new JLinkedList("description");
067: }
068:
069: /**
070: * Gets the id
071: * @return the id
072: */
073: public String getId() {
074: return id;
075: }
076:
077: /**
078: * Set the id
079: * @param id id
080: */
081: public void setId(String id) {
082: this .id = id;
083: }
084:
085: /**
086: * Gets the description
087: * @return the description
088: */
089: public JLinkedList getDescriptionList() {
090: return descriptionList;
091: }
092:
093: /**
094: * Set the description
095: * @param descriptionList description
096: */
097: public void setDescriptionList(JLinkedList descriptionList) {
098: this .descriptionList = descriptionList;
099: }
100:
101: /**
102: * Add a new description element to this object
103: * @param description the description String
104: */
105: public void addDescription(String description) {
106: descriptionList.add(description);
107: }
108:
109: /**
110: * Gets the jndiname
111: * @return the jndiname
112: */
113: public String getJndiName() {
114: return jndiName;
115: }
116:
117: /**
118: * Set the jndiname
119: * @param jndiName jndiname
120: */
121: public void setJndiName(String jndiName) {
122: this .jndiName = jndiName;
123: }
124:
125: /**
126: * Gets the defaultAS
127: * @return the defaultAS
128: */
129: public String getDefaultAS() {
130: return defaultAS;
131: }
132:
133: /**
134: * Set the defaultAS
135: * @param defaultAS defaultAS
136: */
137: public void setDefaultAS(String defaultAS) {
138: this .defaultAS = defaultAS;
139: }
140:
141: /**
142: * Represents this element by it's XML description.
143: * @param indent use this indent for prefixing XML representation.
144: * @return the XML description of this object.
145: */
146: public String toXML(int indent) {
147: StringBuffer sb = new StringBuffer();
148: sb.append(indent(indent));
149: sb.append("<jonas-activationspec>\n");
150:
151: indent += 2;
152:
153: // id
154: sb.append(xmlElement(id, "id", indent));
155: // description
156: sb.append(descriptionList.toXML(indent));
157: // jndiname
158: sb.append(xmlElement(jndiName, "jndi-name", indent));
159: // defaultAS
160: sb.append(xmlElement(defaultAS, "defaultAS", indent));
161:
162: indent -= 2;
163: sb.append(indent(indent));
164: sb.append("</jonas-activationspec>\n");
165:
166: return sb.toString();
167: }
168: }
|