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: Eric Hardesty
022: * --------------------------------------------------------------------------
023: * $Id: MessageDestinationRef.java 5049 2004-07-01 15:35:10Z sauthieg $
024: * --------------------------------------------------------------------------
025: */package org.objectweb.jonas_lib.deployment.xml;
026:
027: /**
028: * This class defines the implementation of the element message-destination-ref.
029: * @author Eric Hardesty
030: */
031: public class MessageDestinationRef extends AbsElement {
032:
033: /**
034: * Description of the message-destination-ref
035: */
036: private String description = null;
037:
038: /**
039: * Name of this message-destination-ref
040: */
041: private String messageDestinationRefName = null;
042:
043: /**
044: * Type of this message-destination-ref
045: */
046: private String messageDestinationType = null;
047:
048: /**
049: * Usage of this message-destination-ref
050: */
051: private String messageDestinationUsage = null;
052:
053: /**
054: * Link of this message-destination-ref
055: */
056: private String messageDestinationLink = null;
057:
058: // Setters
059:
060: /**
061: * Sets the description
062: * @param description the description to use
063: */
064: public void setDescription(String description) {
065: this .description = description;
066: }
067:
068: /**
069: * Sets the name
070: * @param refName the name to use
071: */
072: public void setMessageDestinationRefName(String refName) {
073: this .messageDestinationRefName = refName;
074: }
075:
076: /**
077: * Sets the type
078: * @param type the type to use
079: */
080: public void setMessageDestinationType(String type) {
081: this .messageDestinationType = type;
082: }
083:
084: /**
085: * Sets the usage
086: * @param usage the usage to use
087: */
088: public void setMessageDestinationUsage(String usage) {
089: this .messageDestinationUsage = usage;
090: }
091:
092: /**
093: * Sets the link
094: * @param link the link to use
095: */
096: public void setMessageDestinationLink(String link) {
097: this .messageDestinationLink = link;
098: }
099:
100: // Getters
101:
102: /**
103: * @return the description of the messageDestination-ref
104: */
105: public String getDescription() {
106: return description;
107: }
108:
109: /**
110: * @return the name of the messageDestination-ref
111: */
112: public String getMessageDestinationRefName() {
113: return messageDestinationRefName;
114: }
115:
116: /**
117: * @return the type of the messageDestination-ref
118: */
119: public String getMessageDestinationType() {
120: return messageDestinationType;
121: }
122:
123: /**
124: * @return the usage of the messageDestination-ref
125: */
126: public String getMessageDestinationUsage() {
127: return messageDestinationUsage;
128: }
129:
130: /**
131: * @return the link of the messageDestination-ref
132: */
133: public String getMessageDestinationLink() {
134: return messageDestinationLink;
135: }
136:
137: /**
138: * Represents this element by it's XML description.
139: * @param indent use this indent for prexifing XML representation.
140: * @return the XML description of this object.
141: */
142: public String toXML(int indent) {
143: StringBuffer sb = new StringBuffer();
144: sb.append(indent(indent));
145: sb.append("<message-destination-ref>\n");
146:
147: indent += 2;
148:
149: // Description
150: sb.append(xmlElement(description, "description", indent));
151:
152: // name
153: sb.append(xmlElement(messageDestinationRefName,
154: "message-destination-ref-name", indent));
155:
156: // type
157: sb.append(xmlElement(messageDestinationType,
158: "message-destination-type", indent));
159:
160: // usage
161: sb.append(xmlElement(messageDestinationUsage,
162: "message-destination-usage", indent));
163:
164: // link
165: sb.append(xmlElement(messageDestinationLink,
166: "message-destination-link", indent));
167:
168: indent -= 2;
169: sb.append(indent(indent));
170: sb.append("</message-destination-ref>\n");
171:
172: return sb.toString();
173: }
174:
175: }
|