KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > caucho > jsp > cfg > TldVariable


1 /*
2  * Copyright (c) 1998-2006 Caucho Technology -- all rights reserved
3  *
4  * This file is part of Resin(R) Open Source
5  *
6  * Each copy or derived work must preserve the copyright notice and this
7  * notice unmodified.
8  *
9  * Resin Open Source is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * Resin Open Source is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
17  * of NON-INFRINGEMENT. See the GNU General Public License for more
18  * details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with Resin Open Source; if not, write to the
22  * Free SoftwareFoundation, Inc.
23  * 59 Temple Place, Suite 330
24  * Boston, MA 02111-1307 USA
25  *
26  * @author Scott Ferguson
27  */

28
29 package com.caucho.jsp.cfg;
30
31 /**
32  * Configuration for the taglib variable in the .tld
33  */

34 public class TldVariable {
35   private String JavaDoc _nameGiven;
36   private String JavaDoc _nameFromAttribute;
37   private String JavaDoc _alias;
38   private String JavaDoc _variableClass;
39   private boolean _declare = true;
40   private String JavaDoc _scope = "NESTED";
41   private String JavaDoc _description;
42
43   /**
44    * Sets a constant name of the variable.
45    */

46   public void setNameGiven(String JavaDoc nameGiven)
47   {
48     _nameGiven = nameGiven;
49   }
50
51   /**
52    * Gets a constant name of the variable.
53    */

54   public String JavaDoc getNameGiven()
55   {
56     return _nameGiven;
57   }
58
59   /**
60    * Sets a variable name determined from an attribute.
61    */

62   public void setNameFromAttribute(String JavaDoc nameFromAttribute)
63   {
64     _nameFromAttribute = nameFromAttribute;
65   }
66
67   /**
68    * Gets a variable name determined from an attribute.
69    */

70   public String JavaDoc getNameFromAttribute()
71   {
72     return _nameFromAttribute;
73   }
74
75   /**
76    * Sets the alias for tag files
77    */

78   public void setAlias(String JavaDoc alias)
79   {
80     _alias = alias;
81   }
82
83   /**
84    * Gets the alias for tag files
85    */

86   public String JavaDoc getAlias()
87   {
88     return _alias;
89   }
90
91   /**
92    * Sets the class of the variable object.
93    */

94   public void setVariableClass(String JavaDoc variableClass)
95   {
96     _variableClass = variableClass;
97   }
98
99   /**
100    * Gets the variable class of the variable value.
101    */

102   public String JavaDoc getVariableClass()
103   {
104     if (_variableClass != null)
105       return _variableClass;
106     else
107       return "java.lang.String";
108   }
109
110   /**
111    * Sets whether the variable is declared or not.
112    */

113   public void setDeclare(boolean declare)
114   {
115     _declare = declare;
116   }
117
118   /**
119    * Return true if the variable should be declared.
120    */

121   public boolean getDeclare()
122   {
123     return _declare;
124   }
125
126   /**
127    * Sets the variable scope.
128    */

129   public void setScope(String JavaDoc scope)
130   {
131     _scope = scope;
132   }
133
134   /**
135    * Return the variable scope
136    */

137   public String JavaDoc getScope()
138   {
139     return _scope;
140   }
141
142   /**
143    * Sets the description.
144    */

145   public void setDescription(String JavaDoc description)
146   {
147     _description = description;
148   }
149
150   /**
151    * Return the descrption
152    */

153   public String JavaDoc getDescription()
154   {
155     return _description;
156   }
157 }
158
Popular Tags