KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ejb > deployment > xml > CmrField


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  *
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or 1any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with this library; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20  * USA
21  *
22  * Initial developer: JOnAS team
23  * --------------------------------------------------------------------------
24  * $Id: CmrField.java,v 1.6 2004/05/10 11:45:44 sauthieg Exp $
25  * --------------------------------------------------------------------------
26  */

27 package org.objectweb.jonas_ejb.deployment.xml;
28
29 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
30 /**
31  * This class defines the implementation of the element cmr-field
32  *
33  * @author JOnAS team
34  */

35
36 public class CmrField extends AbsElement {
37
38     /**
39      * description
40      */

41     private String JavaDoc description = null;
42
43     /**
44      * cmr-field-name
45      */

46     private String JavaDoc cmrFieldName = null;
47
48     /**
49      * cmr-field-type
50      */

51     private String JavaDoc cmrFieldType = null;
52
53
54     /**
55      * Constructor
56      */

57     public CmrField() {
58         super();
59     }
60
61     /**
62      * Gets the description
63      * @return the description
64      */

65     public String JavaDoc getDescription() {
66         return description;
67     }
68
69     /**
70      * Set the description
71      * @param description description
72      */

73     public void setDescription(String JavaDoc description) {
74         this.description = description;
75     }
76
77     /**
78      * Gets the cmr-field-name
79      * @return the cmr-field-name
80      */

81     public String JavaDoc getCmrFieldName() {
82         return cmrFieldName;
83     }
84
85     /**
86      * Set the cmr-field-name
87      * @param cmrFieldName cmrFieldName
88      */

89     public void setCmrFieldName(String JavaDoc cmrFieldName) {
90         this.cmrFieldName = cmrFieldName;
91     }
92
93     /**
94      * Gets the cmr-field-type
95      * @return the cmr-field-type
96      */

97     public String JavaDoc getCmrFieldType() {
98         return cmrFieldType;
99     }
100
101     /**
102      * Set the cmr-field-type
103      * @param cmrFieldType cmrFieldType
104      */

105     public void setCmrFieldType(String JavaDoc cmrFieldType) {
106         this.cmrFieldType = cmrFieldType;
107     }
108
109     /**
110      * Represents this element by it's XML description.
111      * @param indent use this indent for prexifing XML representation.
112      * @return the XML description of this object.
113      */

114     public String JavaDoc toXML(int indent) {
115         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
116         sb.append(indent(indent));
117         sb.append("<cmr-field>\n");
118
119         indent += 2;
120
121         // description
122
sb.append(xmlElement(description, "description", indent));
123         // cmr-field-name
124
sb.append(xmlElement(cmrFieldName, "cmr-field-name", indent));
125         // cmr-field-type
126
sb.append(xmlElement(cmrFieldType, "cmr-field-type", indent));
127         indent -= 2;
128         sb.append(indent(indent));
129         sb.append("</cmr-field>\n");
130
131         return sb.toString();
132     }
133 }
134
Popular Tags