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