KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas_ear > deployment > xml > JonasApplication


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

26 package org.objectweb.jonas_ear.deployment.xml;
27
28 import org.objectweb.jonas_lib.deployment.xml.AbsDescriptionElement;
29 import org.objectweb.jonas_lib.deployment.xml.DescriptionGroupXml;
30 import org.objectweb.jonas_lib.deployment.xml.TopLevelElement;
31
32 /**
33  * This class defines the implementation of the element jonas-application
34  * @author Florent Benoit
35  */

36 public class JonasApplication extends AbsDescriptionElement implements TopLevelElement, DescriptionGroupXml {
37
38     /**
39      * Header (with right XSD version) for XML
40      */

41     private String JavaDoc header = null;
42
43     /**
44      * Element jonas-security
45      */

46     private JonasSecurity jonasSecurity = null;
47
48     /**
49      * Constructor
50      */

51     public JonasApplication() {
52         super();
53     }
54
55     /**
56      * Represents this element by it's XML description.
57      * @param indent use this indent for prexifing XML representation.
58      * @return the XML description of this object.
59      */

60     public String JavaDoc toXML(int indent) {
61         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
62         sb.append(indent(indent));
63         if (header != null) {
64             sb.append(header);
65         } else {
66             sb.append("<jonas-application>\n");
67         }
68         indent += 2;
69
70         // jonas-security
71
if (jonasSecurity != null) {
72             sb.append(jonasSecurity.toXML(indent));
73         }
74
75         indent -= 2;
76         sb.append(indent(indent));
77         sb.append("</jonas-application>\n");
78
79         return sb.toString();
80     }
81
82     /**
83      * @return the jonasSecurity.
84      */

85     public JonasSecurity getJonasSecurity() {
86         return jonasSecurity;
87     }
88
89     /**
90      * @param jonasSecurity The jonasSecurity to set.
91      */

92     public void setJonasSecurity(JonasSecurity jonasSecurity) {
93         this.jonasSecurity = jonasSecurity;
94     }
95
96     /**
97      * @return the header.
98      */

99     public String JavaDoc getHeader() {
100         return header;
101     }
102
103     /**
104      * @param header The header to set.
105      */

106     public void setHeader(String JavaDoc header) {
107         this.header = header;
108     }
109 }
Popular Tags