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: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or 1any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * Initial developer: Florent BENOIT
022: * --------------------------------------------------------------------------
023: * $Id: ResourceEnvRef.java 4718 2004-05-10 12:06:09Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines the implementation of the element resource-env-ref.
029: * @author Florent Benoit
030: */
031: public class ResourceEnvRef extends AbsElement {
032:
033: /**
034: * Description of the resource-env-ref
035: */
036: private String description = null;
037:
038: /**
039: * Name of this resource-env-ref
040: */
041: private String resourceEnvRefName = null;
042:
043: /**
044: * Type of this resource-env-ref
045: */
046: private String resourceEnvRefType = null;
047:
048: // Setters
049:
050: /**
051: * Sets the description
052: * @param description the description to use
053: */
054: public void setDescription(String description) {
055: this .description = description;
056: }
057:
058: /**
059: * Sets the name
060: * @param resourceEnvRefName the name to use
061: */
062: public void setResourceEnvRefName(String resourceEnvRefName) {
063: this .resourceEnvRefName = resourceEnvRefName;
064: }
065:
066: /**
067: * Sets the type
068: * @param resourceEnvRefType the type to use
069: */
070: public void setResourceEnvRefType(String resourceEnvRefType) {
071: this .resourceEnvRefType = resourceEnvRefType;
072: }
073:
074: // Getters
075:
076: /**
077: * @return the description of the resource-env-ref
078: */
079: public String getDescription() {
080: return description;
081: }
082:
083: /**
084: * @return the name of the resource-env-ref
085: */
086: public String getResourceEnvRefName() {
087: return resourceEnvRefName;
088: }
089:
090: /**
091: * @return the type of the resource-env-ref
092: */
093: public String getResourceEnvRefType() {
094: return resourceEnvRefType;
095: }
096:
097: /**
098: * Represents this element by it's XML description.
099: * @param indent use this indent for prexifing XML representation.
100: * @return the XML description of this object.
101: */
102: public String toXML(int indent) {
103: StringBuffer sb = new StringBuffer();
104: sb.append(indent(indent));
105: sb.append("<resource-env-ref>\n");
106:
107: indent += 2;
108:
109: // Description
110: sb.append(xmlElement(description, "description", indent));
111:
112: // name
113: sb.append(xmlElement(resourceEnvRefName,
114: "resource-env-ref-name", indent));
115:
116: // type
117: sb.append(xmlElement(resourceEnvRefType,
118: "resource-env-ref-type", indent));
119:
120: indent -= 2;
121: sb.append(indent(indent));
122: sb.append("</resource-env-ref>\n");
123:
124: return sb.toString();
125: }
126:
127: }
|