KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > JspConfigDescriptor


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment;
25
26 import java.util.*;
27
28 /**
29  * This is a descriptor for the taglib config used in a web application.
30  */

31 public class JspConfigDescriptor extends Descriptor {
32     
33     private Set list = null;
34     private Vector jspGroups = null;
35     /**
36      * return the set of tag lib elements
37      */

38     public Set getTagLibSet() {
39     if(list == null) {
40         list = new HashSet();
41     }
42     return list;
43     }
44
45     /**
46      * return the enumeration of tag lib elements
47      */

48     public Enumeration getTagLibs() {
49     return (new Vector(this.getTagLibSet())).elements();
50     }
51
52     /**
53      * add a tag lib element to the set.
54      */

55     public void addTagLib(TagLibConfigurationDescriptor desc) {
56     getTagLibSet().add(desc);
57         changed();
58     }
59
60     /**
61      * remove a tag lib element from the set.
62      */

63     public void removeTagLib(TagLibConfigurationDescriptor desc) {
64     getTagLibSet().remove(desc);
65         changed();
66     }
67
68     /**
69      * return the set of jsp-group elements
70      */

71     public Collection getJspGroupSet() {
72     if(jspGroups == null) {
73         jspGroups = new Vector();
74     }
75     return jspGroups;
76     }
77
78     /**
79      * return the enumeration of jsp-group elements
80      */

81     public Enumeration getJspGroups() {
82     return (new Vector(getJspGroupSet())).elements();
83     }
84
85     /**
86      * add a jsp group element to the set.
87      */

88     public void addJspGroup(JspGroupDescriptor desc) {
89     getJspGroupSet().add(desc);
90         changed();
91     }
92
93     /**
94      * remove a jsp group element from the set.
95      */

96     public void removeJspGroup(JspGroupDescriptor desc) {
97     getJspGroupSet().remove(desc);
98         changed();
99     }
100
101     /**
102      * @return a string describing the values I hold
103      */

104     public void print(StringBuffer JavaDoc toStringBuffer) {
105         toStringBuffer.append("\nTagLibs : ").append(list).append(" jsp groups:").append(jspGroups);
106     }
107 }
108
Popular Tags