001: /*
002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
003: * http://www.jaspersoft.com.
004: *
005: * Unless you have purchased a commercial license agreement from JasperSoft,
006: * the following license terms apply:
007: *
008: * This program is free software; you can redistribute it and/or modify
009: * it under the terms of the GNU General Public License version 2 as published by
010: * the Free Software Foundation.
011: *
012: * This program is distributed WITHOUT ANY WARRANTY; and without the
013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
014: * See the GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
018: * or write to:
019: *
020: * Free Software Foundation, Inc.,
021: * 59 Temple Place - Suite 330,
022: * Boston, MA USA 02111-1307
023: *
024: *
025: *
026: *
027: * JRParameter.java
028: *
029: */
030:
031: package it.businesslogic.ireport;
032:
033: import java.util.Iterator;
034:
035: public class JRParameter {
036: private String name;
037: private String classType;
038: private String description = "";
039: private String defaultValueExpression = "";
040: private boolean isForPrompting = true;
041: private boolean builtin = false;
042: private Object lastDefaultValue = null;
043:
044: private java.util.List properties = new java.util.ArrayList();
045:
046: public JRParameter(String name, String classType,
047: boolean isForPrompting, String description, boolean builtin) {
048: this .name = name;
049: this .classType = classType;
050: this .isForPrompting = isForPrompting;
051: this .description = description;
052: this .builtin = builtin;
053: }
054:
055: public JRParameter(String name, String classType,
056: boolean isForPrompting, String description) {
057: this (name, classType, isForPrompting, description, false);
058: }
059:
060: public JRParameter(String name, String classType,
061: boolean isForPrompting) {
062: this (name, classType, isForPrompting, "", false);
063: }
064:
065: public JRParameter(String name, String classType) {
066: this (name, classType, true, "", false);
067: }
068:
069: public String toString() {
070: return name;
071: }
072:
073: /** Getter for property classType.
074: * @return Value of property classType.
075: *
076: */
077: public java.lang.String getClassType() {
078: return classType;
079: }
080:
081: /** Setter for property classType.
082: * @param classType New value of property classType.
083: *
084: */
085: public void setClassType(java.lang.String classType) {
086: this .classType = classType;
087: }
088:
089: /** Getter for property defaultValueExpression.
090: * @return Value of property defaultValueExpression.
091: *
092: */
093: public java.lang.String getDefaultValueExpression() {
094: return defaultValueExpression;
095: }
096:
097: /** Setter for property defaultValueExpression.
098: * @param defaultValueExpression New value of property defaultValueExpression.
099: *
100: */
101: public void setDefaultValueExpression(
102: java.lang.String defaultValueExpression) {
103: this .defaultValueExpression = defaultValueExpression;
104: }
105:
106: /** Getter for property description.
107: * @return Value of property description.
108: *
109: */
110: public java.lang.String getDescription() {
111: return description;
112: }
113:
114: /** Setter for property description.
115: * @param description New value of property description.
116: *
117: */
118: public void setDescription(java.lang.String description) {
119: this .description = description;
120: }
121:
122: /** Getter for property isForPrompting.
123: * @return Value of property isForPrompting.
124: *
125: */
126: public boolean isIsForPrompting() {
127: return isForPrompting;
128: }
129:
130: /** Setter for property isForPrompting.
131: * @param isForPrompting New value of property isForPrompting.
132: *
133: */
134: public void setIsForPrompting(boolean isForPrompting) {
135: this .isForPrompting = isForPrompting;
136: }
137:
138: /** Getter for property name.
139: * @return Value of property name.
140: *
141: */
142: public java.lang.String getName() {
143: return name;
144: }
145:
146: /** Setter for property name.
147: * @param name New value of property name.
148: *
149: */
150: public void setName(java.lang.String name) {
151: this .name = name;
152: }
153:
154: public JRParameter cloneMe() {
155: JRParameter jrp = new JRParameter(name, classType,
156: isForPrompting, description);
157:
158: jrp.setDefaultValueExpression(defaultValueExpression);
159: jrp.setBuiltin(isBuiltin());
160:
161: Iterator iter = getProperties().iterator();
162: while (iter.hasNext()) {
163: JRProperty p = (JRProperty) iter.next();
164: jrp.getProperties().add(p.cloneMe());
165: }
166:
167: return jrp;
168: }
169:
170: public boolean isBuiltin() {
171: return builtin;
172: }
173:
174: public void setBuiltin(boolean builtin) {
175: this .builtin = builtin;
176: }
177:
178: public Object getLastDefaultValue() {
179: return lastDefaultValue;
180: }
181:
182: public void setLastDefaultValue(Object lastDefaultValue) {
183: this .lastDefaultValue = lastDefaultValue;
184: }
185:
186: public java.util.List getProperties() {
187: return properties;
188: }
189:
190: public void setProperties(java.util.List properties) {
191: this.properties = properties;
192: }
193:
194: }
|