KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jahia > data > webapps > Servlet_Element


1 //
2
// ____.
3
// __/\ ______| |__/\. _______
4
// __ .____| | \ | +----+ \
5
// _______| /--| | | - \ _ | : - \_________
6
// \\______: :---| : : | : | \________>
7
// |__\---\_____________:______: :____|____:_____\
8
// /_____|
9
//
10
// . . . i n j a h i a w e t r u s t . . .
11
//
12
//
13
//
14
// Servlet_Element
15
//
16
// NK 29.01.2001
17
//
18
//
19

20 package org.jahia.data.webapps;
21
22
23
24
25 /**
26  * Holds Informations about the <servlet> declaration tag in the descriptors file
27  * web.xml
28  *
29  * <pre>
30  * <web-app>
31  *
32  * <servlet>
33  * <servlet-name>FilemanagerServlet</servlet-name>
34  * <display-name>Filemanager Portlet</display-name>
35  * <desc>no desc</desc>
36  * <servlet-class>org.jahia.portlets.filemanager.FilemanagerServlet</servlet-class>
37  * <init-param>
38  * <param-name>properties</param-name>
39  * <param-value>WEB-INF\conf\config.properties</param-value>
40  * </init-param>
41  * </servlet>
42  *
43  * </web-app>
44  * </pre>
45  *
46  * @author Khue ng
47  * @version 1.0
48  */

49 public class Servlet_Element {
50
51    /** The servlet name <servlet-name> **/
52    private String JavaDoc m_Name;
53    /** The display name <display-name> **/
54    private String JavaDoc m_DisplayName;
55    /** The desc <desc> **/
56    private String JavaDoc m_desc;
57    /** The servlet source <servlet-class> or <jsp-file> **/
58    private String JavaDoc m_Source;
59    /** The servlet Type , 1 = servlet , 2 = jsp **/
60    private int m_Type;
61    /** The servlet number , the order in which they are declared **/
62    private int m_Number;
63
64
65    /**
66     * Constructor
67     *
68     * @param (String) path, the full path to the application.xml file
69     */

70     public Servlet_Element( String JavaDoc name,
71                             String JavaDoc displayName,
72                             String JavaDoc desc,
73                             String JavaDoc source,
74                             int type,
75                             int servletNumber
76                         ){
77
78        m_Name = name;
79        m_DisplayName = displayName;
80        m_desc = desc;
81        m_Source = source;
82        m_Type = type;
83        m_Number = servletNumber;
84
85     }
86
87
88    /**
89     * Return the servlet Name
90     *
91     * @return (String) the servlet Name
92     */

93    public String JavaDoc getName(){
94
95       return m_Name;
96    }
97
98
99    /**
100     * Set the servlet Name
101     *
102     * @param (String) the servlet Name
103     */

104    public void setName(String JavaDoc name){
105
106       m_Name = name;
107    }
108
109
110    /**
111     * Return the servlet display name
112     *
113     * @return (String) the servlet display name
114     */

115    public String JavaDoc getDisplayName(){
116
117       return m_DisplayName;
118    }
119
120
121    /**
122     * Set the servlet display name
123     *
124     * @param (String) the servlet display name
125     */

126    public void setDisplayName(String JavaDoc name){
127
128       m_DisplayName = name;
129    }
130
131
132    /**
133     * Return the servlet desc
134     *
135     * @return (String) the desc
136     */

137    public String JavaDoc getdesc(){
138
139       return m_desc;
140    }
141
142
143    /**
144     * Set the servlet desc
145     *
146     * @param (String) the desc
147     */

148    public void setdesc(String JavaDoc descr){
149
150       m_desc = descr;
151    }
152
153
154    /**
155     * Return the servlet source
156     *
157     * @return (String) the servlet source
158     */

159    public String JavaDoc getSource(){
160
161       return m_Source;
162    }
163
164
165    /**
166     * Set the servlet source ( a class or jsp file )
167     *
168     * @param (String) the servlet source
169     */

170    public void setSource(String JavaDoc servletsrc){
171
172       m_Source = servletsrc;
173    }
174
175
176    /**
177     * Return the servlet type
178     *
179     * @return (int) the servlet type
180     */

181    public int getType(){
182
183       return m_Type;
184    }
185
186
187    /**
188     * Return the servlet type label
189     *
190     * @return (String) the servlet type label
191     */

192    public String JavaDoc getTypeLabel(){
193
194         if ( m_Type==1 ){
195             return "Servlet";
196         } else {
197             return "Jsp";
198         }
199    }
200
201
202    /**
203     * Set the servlet type ( 1 = servlet, 2 = jsp )
204     *
205     * @param (int) the servlet type
206     */

207    public void setType(int servletType){
208
209       m_Type = servletType;
210    }
211
212
213    /**
214     * Return the servlet number
215     *
216     * @return (int) the servlet number
217     */

218    public int getNumber(){
219
220       return m_Number;
221    }
222
223    /**
224     * Set the servlet number
225     *
226     * @param (int) the number
227     */

228    public void setNumber(int servletNumber){
229
230       m_Number = servletNumber;
231    }
232
233
234 } // end Servlet_Element
235
Popular Tags