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: CmrField.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:
030: /**
031: * This class defines the implementation of the element cmr-field
032: *
033: * @author JOnAS team
034: */
035:
036: public class CmrField extends AbsElement {
037:
038: /**
039: * description
040: */
041: private String description = null;
042:
043: /**
044: * cmr-field-name
045: */
046: private String cmrFieldName = null;
047:
048: /**
049: * cmr-field-type
050: */
051: private String cmrFieldType = null;
052:
053: /**
054: * Constructor
055: */
056: public CmrField() {
057: super ();
058: }
059:
060: /**
061: * Gets the description
062: * @return the description
063: */
064: public String getDescription() {
065: return description;
066: }
067:
068: /**
069: * Set the description
070: * @param description description
071: */
072: public void setDescription(String description) {
073: this .description = description;
074: }
075:
076: /**
077: * Gets the cmr-field-name
078: * @return the cmr-field-name
079: */
080: public String getCmrFieldName() {
081: return cmrFieldName;
082: }
083:
084: /**
085: * Set the cmr-field-name
086: * @param cmrFieldName cmrFieldName
087: */
088: public void setCmrFieldName(String cmrFieldName) {
089: this .cmrFieldName = cmrFieldName;
090: }
091:
092: /**
093: * Gets the cmr-field-type
094: * @return the cmr-field-type
095: */
096: public String getCmrFieldType() {
097: return cmrFieldType;
098: }
099:
100: /**
101: * Set the cmr-field-type
102: * @param cmrFieldType cmrFieldType
103: */
104: public void setCmrFieldType(String cmrFieldType) {
105: this .cmrFieldType = cmrFieldType;
106: }
107:
108: /**
109: * Represents this element by it's XML description.
110: * @param indent use this indent for prexifing XML representation.
111: * @return the XML description of this object.
112: */
113: public String toXML(int indent) {
114: StringBuffer sb = new StringBuffer();
115: sb.append(indent(indent));
116: sb.append("<cmr-field>\n");
117:
118: indent += 2;
119:
120: // description
121: sb.append(xmlElement(description, "description", indent));
122: // cmr-field-name
123: sb.append(xmlElement(cmrFieldName, "cmr-field-name", indent));
124: // cmr-field-type
125: sb.append(xmlElement(cmrFieldType, "cmr-field-type", indent));
126: indent -= 2;
127: sb.append(indent(indent));
128: sb.append("</cmr-field>\n");
129:
130: return sb.toString();
131: }
132: }
|