KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > design > JRCompilationUnit


1 /*
2  * ============================================================================
3  * GNU Lesser General Public License
4  * ============================================================================
5  *
6  * JasperReports - Free Java report-generating library.
7  * Copyright (C) 2001-2006 JasperSoft Corporation http://www.jaspersoft.com
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 2.1 of the License, or (at your option) any later version.
13  *
14  * This library is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this library; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22  *
23  * JasperSoft Corporation
24  * 303 Second Street, Suite 450 North
25  * San Francisco, CA 94107
26  * http://www.jaspersoft.com
27  */

28 package net.sf.jasperreports.engine.design;
29
30 import java.io.File JavaDoc;
31 import java.io.Serializable JavaDoc;
32 import java.util.List JavaDoc;
33
34 /**
35  * Expression evaluator compilation unit used by report compilers.
36  *
37  * @author Lucian Chirita (lucianc@users.sourceforge.net)
38  * @version $Id: JRCompilationUnit.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
39  */

40 public class JRCompilationUnit
41 {
42     /**
43      * The name of the unit.
44      */

45     private final String JavaDoc name;
46     
47     /**
48      * The source code generated for the unit.
49      */

50     private final String JavaDoc source;
51     
52     /**
53      * The file where the source code was saved.
54      */

55     private final File JavaDoc sourceFile;
56     
57     /**
58      * The list of expressions.
59      */

60     private final List JavaDoc expressions;
61     
62     /**
63      * The compilation data used for creating expression evaluators.
64      */

65     private Serializable JavaDoc compileData;
66     
67     
68     /**
69      * Creates a compilation unit.
70      *
71      * @param name the name of the unit
72      * @param source the source code generated for the unit
73      * @param sourceFile the file where the source code was saved
74      * @param expressions the list of expressions
75      */

76     public JRCompilationUnit(String JavaDoc name, String JavaDoc source, File JavaDoc sourceFile, List JavaDoc expressions)
77     {
78         this.name = name;
79         this.source = source;
80         this.sourceFile = sourceFile;
81         this.expressions = expressions;
82     }
83
84     
85     /**
86      * Returns the name of the unit.
87      *
88      * @return the name of the unit
89      */

90     public String JavaDoc getName()
91     {
92         return name;
93     }
94
95     
96     /**
97      * Returns the source code generated for the unit.
98      * @return the source code generated for the unit
99      */

100     public String JavaDoc getSourceCode()
101     {
102         return source;
103     }
104
105     
106     /**
107      * Returns the file where the source code was saved.
108      * @return the file where the source code was saved
109      */

110     public File JavaDoc getSourceFile()
111     {
112         return sourceFile;
113     }
114     
115     
116     /**
117      * Returns the list of expressions.
118      * @return the list of expressions
119      */

120     public List JavaDoc getExpressions()
121     {
122         return expressions;
123     }
124     
125     
126     /**
127      * Sets the compilation data used for creating expression evaluators.
128      *
129      * @param compileData the compilation data
130      */

131     public void setCompileData(Serializable JavaDoc compileData)
132     {
133         this.compileData = compileData;
134     }
135     
136     
137     /**
138      * Returns the compilation data used for creating expression evaluators.
139      * @return the compilation data used for creating expression evaluators
140      */

141     public Serializable JavaDoc getCompileData()
142     {
143         return compileData;
144     }
145 }
146
Popular Tags