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: * JRField.java
028: *
029: */
030:
031: package it.businesslogic.ireport;
032:
033: import it.businesslogic.ireport.util.Misc;
034: import java.util.Iterator;
035:
036: public class JRField {
037: private String name;
038: private String description = "";
039: private String classType;
040:
041: private java.util.List properties = new java.util.ArrayList();
042:
043: public JRField(String name, String classType) {
044: this .name = name;
045: this .classType = classType;
046: }
047:
048: public String toString() {
049: return name;
050: }
051:
052: /** Getter for property classType.
053: * @return Value of property classType.
054: *
055: */
056: public java.lang.String getClassType() {
057: return classType;
058: }
059:
060: /** Setter for property classType.
061: * @param classType New value of property classType.
062: *
063: */
064: public void setClassType(java.lang.String classType) {
065: this .classType = Misc.getJRFieldType(classType);
066: }
067:
068: /** Getter for property description.
069: * @return Value of property description.
070: *
071: */
072: public java.lang.String getDescription() {
073: return description;
074: }
075:
076: /** Setter for property description.
077: * @param description New value of property description.
078: *
079: */
080: public void setDescription(java.lang.String description) {
081: this .description = description;
082: }
083:
084: /** Getter for property name.
085: * @return Value of property name.
086: *
087: */
088: public java.lang.String getName() {
089: return name;
090: }
091:
092: /** Setter for property name.
093: * @param name New value of property name.
094: *
095: */
096: public void setName(java.lang.String name) {
097: this .name = name;
098: }
099:
100: public JRField cloneMe() {
101: JRField jrf = new JRField(name, classType);
102:
103: jrf.setDescription(description);
104:
105: Iterator iter = getProperties().iterator();
106: while (iter.hasNext()) {
107: JRProperty p = (JRProperty) iter.next();
108: jrf.getProperties().add(p.cloneMe());
109: }
110:
111: return jrf;
112: }
113:
114: public java.util.List getProperties() {
115: return properties;
116: }
117:
118: public void setProperties(java.util.List properties) {
119: this.properties = properties;
120: }
121:
122: }
|