KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > taglibs > i18n > BundleTEI


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

16
17 package org.apache.taglibs.i18n;
18
19 import javax.servlet.jsp.tagext.TagData JavaDoc;
20 import javax.servlet.jsp.tagext.TagExtraInfo JavaDoc;
21 import javax.servlet.jsp.tagext.VariableInfo JavaDoc;
22
23
24 /**
25  * Defines the possible JSP beans available within the the body
26  * of the iterator tag.
27  */

28 public class BundleTEI extends TagExtraInfo JavaDoc
29 {
30
31     /**
32      * Returns two VariableInfo objects that define the following
33      * body objects
34      * <UL>
35      * <LI>A variable that represents the current value of the iterator.
36      * The name to reference this object is defined in the iterator tag
37      * with the value "varName". The type of this object is defined by
38      * the "varType" value passed in the iterator tag.
39      * </UL>
40      *
41      * @param data a value of type 'TagData'
42      * @return a value of type 'VariableInfo[]'
43      */

44     public VariableInfo JavaDoc[] getVariableInfo( TagData JavaDoc data )
45     {
46         String JavaDoc varName = data.getAttributeString("id");
47         if ( varName == null ) {
48             return new VariableInfo JavaDoc[] {
49             };
50         } else {
51             return new VariableInfo JavaDoc[] {
52                 new VariableInfo JavaDoc( varName,
53                                   "java.util.ResourceBundle",
54                                   true,
55                                   VariableInfo.AT_BEGIN ),
56             };
57         }
58     }
59
60 }
61
Popular Tags