001: /*
002: * This file is part of the QuickServer library
003: * Copyright (C) 2003-2005 QuickServer.org
004: *
005: * Use, modification, copying and distribution of this software is subject to
006: * the terms and conditions of the GNU Lesser General Public License.
007: * You should have received a copy of the GNU LGP License along with this
008: * library; if not, you can download a copy from <http://www.quickserver.org/>.
009: *
010: * For questions, suggestions, bug-reports, enhancement-requests etc.
011: * visit http://www.quickserver.org
012: *
013: */
014:
015: package org.quickserver.util.xmlreader;
016:
017: /**
018: * This class encapsulate the QSAdmin Plugin configuration.
019: * The xml is <qsadmin-plugin>...</qsadmin-plugin>
020: * @author Akshathkumar Shetty
021: * @since 1.3.2
022: */
023: public class QSAdminPluginConfig implements java.io.Serializable {
024: private String name = "";
025: private String desc = "";
026: private String type = "";
027: private String mainClass = "";
028: private String active = "no";
029:
030: /**
031: * @return description
032: */
033: public String getDesc() {
034: return desc;
035: }
036:
037: /**
038: * @param desc
039: */
040: public void setDesc(String desc) {
041: if (desc != null)
042: this .desc = desc;
043: }
044:
045: /**
046: * @param active Valid Values: <code>true</code> or <code>false</code>
047: */
048: public void setActive(String active) {
049: if (active != null)
050: this .active = active;
051: }
052:
053: /**
054: * Returns active flag.
055: */
056: public String getActive() {
057: return active;
058: }
059:
060: /**
061: * @return MainClass
062: */
063: public String getMainClass() {
064: return mainClass;
065: }
066:
067: /**
068: * @param mainClass
069: */
070: public void setMainClass(String mainClass) {
071: if (mainClass != null)
072: this .mainClass = mainClass;
073: }
074:
075: /**
076: * @return name of the plugin
077: */
078: public String getName() {
079: return name;
080: }
081:
082: /**
083: * @param name
084: */
085: public void setName(String name) {
086: if (name != null)
087: this .name = name;
088: }
089:
090: /**
091: * Returns class which plugin extends or implements.
092: * @return type of plugin.
093: */
094: public String getType() {
095: return type;
096: }
097:
098: /**
099: * @param type of class which plugin extends or implements.
100: */
101: public void setType(String 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 toXML(String pad) {
111: if (pad == null)
112: pad = "";
113: StringBuffer sb = new StringBuffer();
114: sb.append(pad + "<qsadmin-plugin>\n");
115: sb.append(pad + "\t<name>" + getName() + "</name>\n");
116: sb.append(pad + "\t<desc>" + getDesc() + "</desc>\n");
117: sb.append(pad + "\t<type>" + getType() + "</type>\n");
118: sb.append(pad + "\t<main-class>" + getMainClass()
119: + "</main-class>\n");
120: sb.append(pad + "\t<active>" + getActive() + "</active>\n");
121: sb.append(pad + "</qsadmin-plugin>\n");
122: return sb.toString();
123: }
124: }
|