KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > util > xmlreader > QSAdminPluginConfig


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.util.xmlreader;
16
17 /**
18  * This class encapsulate the QSAdmin Plugin configuration.
19  * The xml is &lt;qsadmin-plugin&gt;...&lt;/qsadmin-plugin&gt;
20  * @author Akshathkumar Shetty
21  * @since 1.3.2
22  */

23 public class QSAdminPluginConfig implements java.io.Serializable JavaDoc {
24     private String JavaDoc name="";
25     private String JavaDoc desc="";
26     private String JavaDoc type="";
27     private String JavaDoc mainClass="";
28     private String JavaDoc active="no";
29
30     /**
31      * @return description
32      */

33     public String JavaDoc getDesc() {
34         return desc;
35     }
36
37     /**
38      * @param desc
39      */

40     public void setDesc(String JavaDoc desc) {
41         if(desc!=null)
42             this.desc = desc;
43     }
44
45     /**
46      * @param active Valid Values: <code>true</code> or <code>false</code>
47      */

48     public void setActive(String JavaDoc active) {
49         if(active!=null)
50             this.active = active;
51     }
52
53     /**
54      * Returns active flag.
55      */

56     public String JavaDoc getActive() {
57         return active;
58     }
59     
60     /**
61      * @return MainClass
62      */

63     public String JavaDoc getMainClass() {
64         return mainClass;
65     }
66
67     /**
68      * @param mainClass
69      */

70     public void setMainClass(String JavaDoc mainClass) {
71         if(mainClass!=null)
72             this.mainClass = mainClass;
73     }
74
75     /**
76      * @return name of the plugin
77      */

78     public String JavaDoc getName() {
79         return name;
80     }
81
82     /**
83      * @param name
84      */

85     public void setName(String JavaDoc name) {
86         if(name!=null)
87             this.name = name;
88     }
89
90     /**
91      * Returns class which plugin extends or implements.
92      * @return type of plugin.
93      */

94     public String JavaDoc getType() {
95         return type;
96     }
97
98     /**
99      * @param type of class which plugin extends or implements.
100      */

101     public void setType(String JavaDoc type) {
102         if(type!=null)
103             this.type = type;
104     }
105
106     /**
107      * Returns XML config of this class.
108      * @since 1.3
109      */

110     public String JavaDoc toXML(String JavaDoc pad) {
111         if(pad==null) pad="";
112         StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
113         sb.append(pad+"<qsadmin-plugin>\n");
114         sb.append(pad+"\t<name>"+getName()+"</name>\n");
115         sb.append(pad+"\t<desc>"+getDesc()+"</desc>\n");
116         sb.append(pad+"\t<type>"+getType()+"</type>\n");
117         sb.append(pad+"\t<main-class>"+getMainClass()+"</main-class>\n");
118         sb.append(pad+"\t<active>"+getActive()+"</active>\n");
119         sb.append(pad+"</qsadmin-plugin>\n");
120         return sb.toString();
121     }
122 }
123
Popular Tags