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: RunAs.java 4718 2004-05-10 12:06:09Z sauthieg $
025: * --------------------------------------------------------------------------
026: */package org.objectweb.jonas_lib.deployment.xml;
027:
028: /**
029: * This class defines the implementation of the element run-as
030: *
031: * @author JOnAS team
032: */
033:
034: public class RunAs extends AbsElement {
035:
036: /**
037: * description
038: */
039: private String description = null;
040:
041: /**
042: * role-name
043: */
044: private String roleName = null;
045:
046: /**
047: * Constructor
048: */
049: public RunAs() {
050: super ();
051: }
052:
053: /**
054: * Gets the description
055: * @return the description
056: */
057: public String getDescription() {
058: return description;
059: }
060:
061: /**
062: * Set the description
063: * @param description description
064: */
065: public void setDescription(String description) {
066: this .description = description;
067: }
068:
069: /**
070: * Gets the role-name
071: * @return the role-name
072: */
073: public String getRoleName() {
074: return roleName;
075: }
076:
077: /**
078: * Set the role-name
079: * @param roleName roleName
080: */
081: public void setRoleName(String roleName) {
082: this .roleName = roleName;
083: }
084:
085: /**
086: * Represents this element by it's XML description.
087: * @param indent use this indent for prexifing XML representation.
088: * @return the XML description of this object.
089: */
090: public String toXML(int indent) {
091: StringBuffer sb = new StringBuffer();
092: sb.append(indent(indent));
093: sb.append("<run-as>\n");
094:
095: indent += 2;
096:
097: // description
098: sb.append(xmlElement(description, "description", indent));
099: // role-name
100: sb.append(xmlElement(roleName, "role-name", indent));
101: indent -= 2;
102: sb.append(indent(indent));
103: sb.append("</run-as>\n");
104:
105: return sb.toString();
106: }
107: }
|