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: JOnAS team
023: * --------------------------------------------------------------------------
024: * $Id: ActivationConfig.java 4716 2004-05-10 11:45:44Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_ejb.deployment.xml;
027:
028: import org.objectweb.jonas_lib.deployment.xml.AbsElement;
029: import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
030:
031: /**
032: * This class defines the implementation of the element activation-config
033: *
034: * @author JOnAS team
035: */
036:
037: public class ActivationConfig extends AbsElement {
038:
039: /**
040: * description
041: */
042: private String description = null;
043:
044: /**
045: * activation-config-property
046: */
047: private JLinkedList activationConfigPropertyList = null;
048:
049: /**
050: * Constructor
051: */
052: public ActivationConfig() {
053: super ();
054: activationConfigPropertyList = new JLinkedList(
055: "activation-config-property");
056:
057: }
058:
059: /**
060: * Gets the description
061: * @return the description
062: */
063: public String getDescription() {
064: return description;
065: }
066:
067: /**
068: * Set the description
069: * @param description description
070: */
071: public void setDescription(String description) {
072: this .description = description;
073: }
074:
075: /**
076: * Gets the list of activation-config-property
077: * @return the list of activation-config-property
078: */
079: public JLinkedList getActivationConfigPropertyList() {
080: return activationConfigPropertyList;
081: }
082:
083: /**
084: * Set the activation-config-property
085: * @param activationConfigPropertyList activationConfigProperty
086: */
087: public void setActivationConfigPropertyList(
088: JLinkedList activationConfigPropertyList) {
089: this .activationConfigPropertyList = activationConfigPropertyList;
090: }
091:
092: /**
093: * Add a new activation-config-property element to this object
094: * @param activationConfigProperty the activationConfigPropertyobject
095: */
096: public void addActivationConfigProperty(
097: ActivationConfigProperty activationConfigProperty) {
098: activationConfigPropertyList.add(activationConfigProperty);
099: }
100:
101: /**
102: * Represents this element by it's XML description.
103: * @param indent use this indent for prexifing XML representation.
104: * @return the XML description of this object.
105: */
106: public String toXML(int indent) {
107: StringBuffer sb = new StringBuffer();
108: sb.append(indent(indent));
109: sb.append("<activation-config>\n");
110:
111: indent += 2;
112:
113: // description
114: sb.append(xmlElement(description, "description", indent));
115: // activation-config-property
116: sb.append(activationConfigPropertyList.toXML(indent));
117: indent -= 2;
118: sb.append(indent(indent));
119: sb.append("</activation-config>\n");
120:
121: return sb.toString();
122: }
123: }
|