001: /*
002: * ============================================================================
003: * GNU Lesser General Public License
004: * ============================================================================
005: *
006: * JasperReports - Free Java report-generating library.
007: * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
008: *
009: * This library is free software; you can redistribute it and/or
010: * modify it under the terms of the GNU Lesser General Public
011: * License as published by the Free Software Foundation; either
012: * version 2.1 of the License, or (at your option) any later version.
013: *
014: * This library 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. See the GNU
017: * Lesser General Public License for more details.
018: *
019: * You should have received a copy of the GNU Lesser General Public
020: * License along with this library; if not, write to the Free Software
021: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
022: *
023: * JasperSoft Corporation
024: * 303 Second Street, Suite 450 North
025: * San Francisco, CA 94107
026: * http://www.jaspersoft.com
027: */
028: package net.sf.jasperreports.engine.design;
029:
030: import java.io.File;
031: import java.io.Serializable;
032: import java.util.List;
033:
034: /**
035: * Expression evaluator compilation unit used by report compilers.
036: *
037: * @author Lucian Chirita (lucianc@users.sourceforge.net)
038: * @version $Id: JRCompilationUnit.java 1625 2007-03-09 17:21:31Z lucianc $
039: */
040: public class JRCompilationUnit {
041: /**
042: * The name of the unit.
043: */
044: private final String name;
045:
046: /**
047: * The source code generated for the unit.
048: */
049: private final JRCompilationSourceCode source;
050:
051: /**
052: * The file where the source code was saved.
053: */
054: private final File sourceFile;
055:
056: /**
057: * The list of expressions.
058: */
059: private final List expressions;
060:
061: /**
062: * The compilation data used for creating expression evaluators.
063: */
064: private Serializable compileData;
065:
066: /**
067: * Creates a compilation unit.
068: *
069: * @param name the name of the unit
070: * @param sourceCode the source code generated for the unit
071: * @param sourceFile the file where the source code was saved
072: * @param expressions the list of expressions
073: */
074: public JRCompilationUnit(String name,
075: JRCompilationSourceCode sourceCode, File sourceFile,
076: List expressions) {
077: this .name = name;
078: this .source = sourceCode;
079: this .sourceFile = sourceFile;
080: this .expressions = expressions;
081: }
082:
083: /**
084: * Returns the name of the unit.
085: *
086: * @return the name of the unit
087: */
088: public String getName() {
089: return name;
090: }
091:
092: /**
093: * Returns the source code generated for the unit.
094: * @return the source code generated for the unit
095: */
096: public String getSourceCode() {
097: return source.getCode();
098: }
099:
100: /**
101: * Returns the compilation source code unit.
102: *
103: * @return the compilation source code
104: */
105: public JRCompilationSourceCode getCompilationSource() {
106: return source;
107: }
108:
109: /**
110: * Returns the file where the source code was saved.
111: * @return the file where the source code was saved
112: */
113: public File getSourceFile() {
114: return sourceFile;
115: }
116:
117: /**
118: * Returns the list of expressions.
119: * @return the list of expressions
120: */
121: public List getExpressions() {
122: return expressions;
123: }
124:
125: /**
126: * Sets the compilation data used for creating expression evaluators.
127: *
128: * @param compileData the compilation data
129: */
130: public void setCompileData(Serializable compileData) {
131: this .compileData = compileData;
132: }
133:
134: /**
135: * Returns the compilation data used for creating expression evaluators.
136: * @return the compilation data used for creating expression evaluators
137: */
138: public Serializable getCompileData() {
139: return compileData;
140: }
141: }
|