001: /*
002: * Copyright (C) 2002 Erik Swenson - erik@oreports.com
003: *
004: * This program is free software; you can redistribute it and/or modify it
005: * under the terms of the GNU General Public License as published by the Free
006: * Software Foundation; either version 2 of the License, or (at your option)
007: * any later version.
008: *
009: * This program is distributed in the hope that it will be useful, but WITHOUT
010: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
011: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
012: * more details.
013: *
014: * You should have received a copy of the GNU General Public License along with
015: * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
016: * Place - Suite 330, Boston, MA 02111-1307, USA.
017: *
018: */
019:
020: package org.efs.openreports.objects;
021:
022: import java.io.Serializable;
023:
024: public class ReportParameter implements Serializable {
025: private static final long serialVersionUID = 667082979233371385l;
026:
027: public static String[] TYPES = new String[] { "Date", "List",
028: "Query", "Text", "SubReport", "Boolean" };
029:
030: private static final String STRING = "java.lang.String";
031: private static final String DOUBLE = "java.lang.Double";
032: private static final String INTEGER = "java.lang.Integer";
033: private static final String LONG = "java.lang.Long";
034: private static final String BIGDECIMAL = "java.math.BigDecimal";
035: private static final String DATE = "java.util.Date";
036: private static final String SQL_DATE = "java.sql.Date";
037: private static final String TIMESTAMP = "java.sql.Timestamp";
038: private static final String BOOLEAN = "java.lang.Boolean";
039:
040: public static String[] CLASS_NAMES = new String[] { STRING, DOUBLE,
041: INTEGER, LONG, BIGDECIMAL, DATE, SQL_DATE, TIMESTAMP,
042: BOOLEAN };
043:
044: public static final String QUERY_PARAM = "Query";
045: public static final String LIST_PARAM = "List";
046: public static final String TEXT_PARAM = "Text";
047: public static final String DATE_PARAM = "Date";
048: public static final String SUBREPORT_PARAM = "SubReport";
049: public static final String BOOLEAN_PARAM = "Boolean";
050:
051: private Integer id;
052: private String name;
053: private String type;
054: private String className;
055: private ReportDataSource dataSource;
056: private String data;
057: private ReportParameterValue[] values;
058: private String description;
059: private boolean required;
060: private boolean multipleSelect;
061: private String defaultValue;
062:
063: public ReportDataSource getDataSource() {
064: return dataSource;
065: }
066:
067: public void setDataSource(ReportDataSource dataSource) {
068: this .dataSource = dataSource;
069: }
070:
071: public ReportParameter() {
072: }
073:
074: public String getName() {
075: return name;
076: }
077:
078: public String getType() {
079: return type;
080: }
081:
082: public String getClassName() {
083: return className;
084: }
085:
086: public String getData() {
087: return data;
088: }
089:
090: public ReportParameterValue[] getValues() {
091: return values;
092: }
093:
094: public void setValues(ReportParameterValue[] values) {
095: this .values = values;
096: }
097:
098: public void setClassName(String className) {
099: this .className = className;
100: }
101:
102: public void setData(String data) {
103: this .data = data;
104: }
105:
106: public void setName(String name) {
107: this .name = name;
108: }
109:
110: public void setType(String type) {
111: this .type = type;
112: }
113:
114: public Integer getId() {
115: return id;
116: }
117:
118: public void setId(Integer id) {
119: this .id = id;
120: }
121:
122: public String getDescription() {
123: return description;
124: }
125:
126: public void setDescription(String description) {
127: this .description = description;
128: }
129:
130: public boolean isRequired() {
131: return required;
132: }
133:
134: public void setRequired(boolean required) {
135: this .required = required;
136: }
137:
138: public boolean isMultipleSelect() {
139: return multipleSelect;
140: }
141:
142: public void setMultipleSelect(boolean multiple) {
143: this .multipleSelect = multiple;
144: }
145:
146: public String getDefaultValue() {
147: return defaultValue;
148: }
149:
150: public void setDefaultValue(String defaultValue) {
151: this.defaultValue = defaultValue;
152: }
153:
154: }
|