KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > jasperreports > engine > xml > JRExpressionFactory


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.xml;
29
30 import java.sql.Connection JavaDoc;
31 import java.util.Comparator JavaDoc;
32 import java.util.Date JavaDoc;
33 import java.util.Map JavaDoc;
34
35 import net.sf.jasperreports.engine.JRDataSource;
36 import net.sf.jasperreports.engine.design.JRDesignExpression;
37
38 import org.xml.sax.Attributes JavaDoc;
39
40
41 /**
42  * @author Teodor Danciu (teodord@users.sourceforge.net)
43  * @version $Id: JRExpressionFactory.java 1229 2006-04-19 13:27:35 +0300 (Wed, 19 Apr 2006) teodord $
44  */

45 public class JRExpressionFactory
46 {
47     
48     /**
49      *
50      */

51     public static class ObjectExpressionFactory extends JRBaseFactory {
52         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
53             JRDesignExpression expression = new JRDesignExpression();
54             expression.setValueClassName( Object JavaDoc.class.getName() );
55             return expression;
56         }
57     }
58     
59     /**
60      *
61      */

62     public static class ConnectionExpressionFactory extends JRBaseFactory {
63         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
64             JRDesignExpression expression = new JRDesignExpression();
65             expression.setValueClassName( Connection JavaDoc.class.getName() );
66             return expression;
67         }
68     }
69     
70     /**
71      *
72      */

73     public static class DataSourceExpressionFactory extends JRBaseFactory {
74         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
75             JRDesignExpression expression = new JRDesignExpression();
76             expression.setValueClassName( JRDataSource.class.getName() );
77             return expression;
78         }
79     }
80     
81     /**
82      *
83      */

84     public static class StringExpressionFactory extends JRBaseFactory {
85         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
86             JRDesignExpression expression = new JRDesignExpression();
87             expression.setValueClassName( String JavaDoc.class.getName() );
88             return expression;
89         }
90     }
91     
92     /**
93      *
94      */

95     public static class DateExpressionFactory extends JRBaseFactory {
96         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
97             JRDesignExpression expression = new JRDesignExpression();
98             expression.setValueClassName( Date JavaDoc.class.getName() );
99             return expression;
100         }
101     }
102     
103     /**
104      *
105      */

106     public static class ComparableExpressionFactory extends JRBaseFactory {
107         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
108             JRDesignExpression expression = new JRDesignExpression();
109             expression.setValueClassName( Comparable JavaDoc.class.getName() );
110             return expression;
111         }
112     }
113     
114     /**
115      *
116      */

117     public static class IntegerExpressionFactory extends JRBaseFactory {
118         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
119             JRDesignExpression expression = new JRDesignExpression();
120             expression.setValueClassName( Integer JavaDoc.class.getName() );
121             return expression;
122         }
123     }
124
125     /**
126      *
127      */

128     public static class NumberExpressionFactory extends JRBaseFactory {
129         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
130             JRDesignExpression expression = new JRDesignExpression();
131             expression.setValueClassName( Number JavaDoc.class.getName() );
132             return expression;
133         }
134     }
135     
136     /**
137      *
138      */

139     public static class BooleanExpressionFactory extends JRBaseFactory {
140         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
141             JRDesignExpression expression = new JRDesignExpression();
142             expression.setValueClassName( Boolean JavaDoc.class.getName() );
143             return expression;
144         }
145     }
146
147     /**
148      *
149      */

150     public static class MapExpressionFactory extends JRBaseFactory {
151         public Object JavaDoc createObject( Attributes JavaDoc attrs ){
152             JRDesignExpression expression = new JRDesignExpression();
153             expression.setValueClassName( Map JavaDoc.class.getName() );
154             return expression;
155         }
156     }
157
158     public static class ComparatorExpressionFactory extends JRBaseFactory
159     {
160         public Object JavaDoc createObject(Attributes JavaDoc attrs)
161         {
162             JRDesignExpression expression = new JRDesignExpression();
163             expression.setValueClassName(Comparator JavaDoc.class.getName());
164             return expression;
165         }
166     }
167
168 }
169
Popular Tags