KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > servlet > jsp > tagext > TagVariableInfo


1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. See the NOTICE file distributed with
4 * this work for additional information regarding copyright ownership.
5 * The ASF licenses this file to You under the Apache License, Version 2.0
6 * (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */

17
18  
19 package javax.servlet.jsp.tagext;
20
21 /**
22  * Variable information for a tag in a Tag Library;
23  * This class is instantiated from the Tag Library Descriptor file (TLD)
24  * and is available only at translation time.
25  *
26  * This object should be immutable.
27  *
28  * This information is only available in JSP 1.2 format TLDs or above.
29  */

30
31 public class TagVariableInfo {
32
33     /**
34      * Constructor for TagVariableInfo.
35      *
36      * @param nameGiven value of <name-given>
37      * @param nameFromAttribute value of <name-from-attribute>
38      * @param className value of <variable-class>
39      * @param declare value of <declare>
40      * @param scope value of <scope>
41      */

42     public TagVariableInfo(
43         String JavaDoc nameGiven,
44         String JavaDoc nameFromAttribute,
45         String JavaDoc className,
46         boolean declare,
47         int scope) {
48     this.nameGiven = nameGiven;
49     this.nameFromAttribute = nameFromAttribute;
50     this.className = className;
51     this.declare = declare;
52     this.scope = scope;
53     }
54
55     /**
56      * The body of the <name-given> element.
57      *
58      * @return The variable name as a constant
59      */

60
61     public String JavaDoc getNameGiven() {
62     return nameGiven;
63     }
64
65     /**
66      * The body of the <name-from-attribute> element.
67      * This is the name of an attribute whose (translation-time)
68      * value will give the name of the variable. One of
69      * <name-given> or <name-from-attribute> is required.
70      *
71      * @return The attribute whose value defines the variable name
72      */

73
74     public String JavaDoc getNameFromAttribute() {
75     return nameFromAttribute;
76     }
77
78     /**
79      * The body of the <variable-class> element.
80      *
81      * @return The name of the class of the variable or
82      * 'java.lang.String' if not defined in the TLD.
83      */

84
85     public String JavaDoc getClassName() {
86     return className;
87     }
88
89     /**
90      * The body of the <declare> element.
91      *
92      * @return Whether the variable is to be declared or not.
93      * If not defined in the TLD, 'true' will be returned.
94      */

95
96     public boolean getDeclare() {
97     return declare;
98     }
99
100     /**
101      * The body of the <scope> element.
102      *
103      * @return The scope to give the variable. NESTED
104      * scope will be returned if not defined in
105      * the TLD.
106      */

107
108     public int getScope() {
109     return scope;
110     }
111
112
113     /*
114      * private fields
115      */

116     private String JavaDoc nameGiven; // <name-given>
117
private String JavaDoc nameFromAttribute; // <name-from-attribute>
118
private String JavaDoc className; // <class>
119
private boolean declare; // <declare>
120
private int scope; // <scope>
121
}
122
Popular Tags