001: /*
002: * Copyright (c) 1998-2008 Caucho Technology -- all rights reserved
003: *
004: * This file is part of Resin(R) Open Source
005: *
006: * Each copy or derived work must preserve the copyright notice and this
007: * notice unmodified.
008: *
009: * Resin Open Source is free software; you can redistribute it and/or modify
010: * it under the terms of the GNU General Public License as published by
011: * the Free Software Foundation; either version 2 of the License, or
012: * (at your option) any later version.
013: *
014: * Resin Open Source is distributed in the hope that it will be useful,
015: * but WITHOUT ANY WARRANTY; without even the implied warranty of
016: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
017: * of NON-INFRINGEMENT. See the GNU General Public License for more
018: * details.
019: *
020: * You should have received a copy of the GNU General Public License
021: * along with Resin Open Source; if not, write to the
022: * Free SoftwareFoundation, Inc.
023: * 59 Temple Place, Suite 330
024: * Boston, MA 02111-1307 USA
025: *
026: * @author Scott Ferguson
027: */
028:
029: package com.caucho.jsp.cfg;
030:
031: /**
032: * Configuration for the taglib variable in the .tld
033: */
034: public class TldVariable {
035: private String _nameGiven;
036: private String _nameFromAttribute;
037: private String _alias;
038: private String _variableClass;
039: private boolean _declare = true;
040: private String _scope = "NESTED";
041: private String _description;
042:
043: /**
044: * Sets a constant name of the variable.
045: */
046: public void setNameGiven(String nameGiven) {
047: _nameGiven = nameGiven;
048: }
049:
050: /**
051: * Gets a constant name of the variable.
052: */
053: public String getNameGiven() {
054: return _nameGiven;
055: }
056:
057: /**
058: * Sets a variable name determined from an attribute.
059: */
060: public void setNameFromAttribute(String nameFromAttribute) {
061: _nameFromAttribute = nameFromAttribute;
062: }
063:
064: /**
065: * Gets a variable name determined from an attribute.
066: */
067: public String getNameFromAttribute() {
068: return _nameFromAttribute;
069: }
070:
071: /**
072: * Sets the alias for tag files
073: */
074: public void setAlias(String alias) {
075: _alias = alias;
076: }
077:
078: /**
079: * Gets the alias for tag files
080: */
081: public String getAlias() {
082: return _alias;
083: }
084:
085: /**
086: * Sets the class of the variable object.
087: */
088: public void setVariableClass(String variableClass) {
089: _variableClass = variableClass;
090: }
091:
092: /**
093: * Gets the variable class of the variable value.
094: */
095: public String getVariableClass() {
096: if (_variableClass != null)
097: return _variableClass;
098: else
099: return "java.lang.String";
100: }
101:
102: /**
103: * Sets whether the variable is declared or not.
104: */
105: public void setDeclare(boolean declare) {
106: _declare = declare;
107: }
108:
109: /**
110: * Return true if the variable should be declared.
111: */
112: public boolean getDeclare() {
113: return _declare;
114: }
115:
116: /**
117: * Sets the variable scope.
118: */
119: public void setScope(String scope) {
120: _scope = scope;
121: }
122:
123: /**
124: * Return the variable scope
125: */
126: public String getScope() {
127: return _scope;
128: }
129:
130: /**
131: * Sets the description.
132: */
133: public void setDescription(String description) {
134: _description = description;
135: }
136:
137: /**
138: * Return the descrption
139: */
140: public String getDescription() {
141: return _description;
142: }
143: }
|