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: * JRVariable.java
028: *
029: * Created on 12 febbraio 2003, 21.45
030: *
031: */
032:
033: package it.businesslogic.ireport;
034:
035: public class JRVariable {
036: private String name;
037: private String classType;
038: private String resetType;
039: private String resetGroup;
040: private String calculation;
041: private String expression;
042: private String initialValueExpression;
043: private boolean builtin;
044: private String incrementerFactoryClass = "";
045: private String incrementType = "None";
046: private String incrementGroup = "";
047:
048: public JRVariable(String name, boolean builtin) {
049: this (name, "java.lang.String", builtin);
050: }
051:
052: public JRVariable(String name, String classType, boolean builtin) {
053: this .name = name;
054: this .builtin = builtin;
055:
056: this .classType = classType;
057: resetType = "";
058: resetGroup = "";
059: calculation = "";
060: expression = "";
061: initialValueExpression = "";
062: }
063:
064: /** Getter for property builtin.
065: * @return Value of property builtin.
066: *
067: */
068: public boolean isBuiltin() {
069: return builtin;
070: }
071:
072: /** Setter for property builtin.
073: * @param builtin New value of property builtin.
074: *
075: */
076: public void setBuiltin(boolean builtin) {
077: this .builtin = builtin;
078: }
079:
080: /** Getter for property calculation.
081: * @return Value of property calculation.
082: *
083: */
084: public java.lang.String getCalculation() {
085: return calculation;
086: }
087:
088: /** Setter for property calculation.
089: * @param calculation New value of property calculation.
090: *
091: */
092: public void setCalculation(java.lang.String calculation) {
093: this .calculation = calculation;
094: }
095:
096: /** Getter for property classType.
097: * @return Value of property classType.
098: *
099: */
100: public java.lang.String getClassType() {
101: return classType;
102: }
103:
104: /** Setter for property classType.
105: * @param classType New value of property classType.
106: *
107: */
108: public void setClassType(java.lang.String classType) {
109: this .classType = classType;
110: }
111:
112: /** Getter for property expression.
113: * @return Value of property expression.
114: *
115: */
116: public java.lang.String getExpression() {
117: return expression;
118: }
119:
120: /** Setter for property expression.
121: * @param expression New value of property expression.
122: *
123: */
124: public void setExpression(java.lang.String expression) {
125: this .expression = expression;
126: }
127:
128: /** Getter for property initialValueExpression.
129: * @return Value of property initialValueExpression.
130: *
131: */
132: public java.lang.String getInitialValueExpression() {
133: return initialValueExpression;
134: }
135:
136: /** Setter for property initialValueExpression.
137: * @param initialValueExpression New value of property initialValueExpression.
138: *
139: */
140: public void setInitialValueExpression(
141: java.lang.String initialValueExpression) {
142: this .initialValueExpression = initialValueExpression;
143: }
144:
145: /** Getter for property name.
146: * @return Value of property name.
147: *
148: */
149: public java.lang.String getName() {
150: return name;
151: }
152:
153: /** Setter for property name.
154: * @param name New value of property name.
155: *
156: */
157: public void setName(java.lang.String name) {
158: this .name = name;
159: }
160:
161: /** Getter for property resetGroup.
162: * @return Value of property resetGroup.
163: *
164: */
165: public java.lang.String getResetGroup() {
166: return resetGroup;
167: }
168:
169: /** Setter for property resetGroup.
170: * @param resetGroup New value of property resetGroup.
171: *
172: */
173: public void setResetGroup(java.lang.String resetGroup) {
174: this .resetGroup = resetGroup;
175: }
176:
177: /** Getter for property resetType.
178: * @return Value of property resetType.
179: *
180: */
181: public java.lang.String getResetType() {
182: return resetType;
183: }
184:
185: /** Setter for property resetType.
186: * @param resetType New value of property resetType.
187: *
188: */
189: public void setResetType(java.lang.String resetType) {
190: this .resetType = resetType;
191: }
192:
193: public String toString() {
194: return name;
195: }
196:
197: /** Getter for property incrementerFactoryClass.
198: * @return Value of property incrementerFactoryClass.
199: *
200: */
201: public java.lang.String getIncrementerFactoryClass() {
202: return incrementerFactoryClass;
203: }
204:
205: /** Setter for property incrementerFactoryClass.
206: * @param incrementerFactoryClass New value of property incrementerFactoryClass.
207: *
208: */
209: public void setIncrementerFactoryClass(
210: java.lang.String incrementerFactoryClass) {
211: this .incrementerFactoryClass = incrementerFactoryClass;
212: }
213:
214: public JRVariable cloneMe() {
215: JRVariable jrv = new JRVariable(name, classType, builtin);
216:
217: jrv.setResetType(resetType);
218: jrv.setResetGroup(resetGroup);
219: jrv.setCalculation(calculation);
220: jrv.setExpression(expression);
221: jrv.setInitialValueExpression(initialValueExpression);
222: jrv.setIncrementerFactoryClass(incrementerFactoryClass);
223: jrv.setIncrementGroup(getIncrementGroup());
224:
225: return jrv;
226: }
227:
228: public String getIncrementType() {
229: return incrementType;
230: }
231:
232: public void setIncrementType(String incrementType) {
233: this .incrementType = incrementType;
234: }
235:
236: public String getIncrementGroup() {
237: return incrementGroup;
238: }
239:
240: public void setIncrementGroup(String incrementGroup) {
241: this.incrementGroup = incrementGroup;
242: }
243: }
|