1 28 package net.sf.jasperreports.engine.xml; 29 30 import java.sql.Connection ; 31 import java.util.Comparator ; 32 import java.util.Date ; 33 import java.util.Map ; 34 35 import net.sf.jasperreports.engine.JRDataSource; 36 import net.sf.jasperreports.engine.design.JRDesignExpression; 37 38 import org.xml.sax.Attributes ; 39 40 41 45 public class JRExpressionFactory 46 { 47 48 51 public static class ObjectExpressionFactory extends JRBaseFactory { 52 public Object createObject( Attributes attrs ){ 53 JRDesignExpression expression = new JRDesignExpression(); 54 expression.setValueClassName( Object .class.getName() ); 55 return expression; 56 } 57 } 58 59 62 public static class ConnectionExpressionFactory extends JRBaseFactory { 63 public Object createObject( Attributes attrs ){ 64 JRDesignExpression expression = new JRDesignExpression(); 65 expression.setValueClassName( Connection .class.getName() ); 66 return expression; 67 } 68 } 69 70 73 public static class DataSourceExpressionFactory extends JRBaseFactory { 74 public Object createObject( Attributes attrs ){ 75 JRDesignExpression expression = new JRDesignExpression(); 76 expression.setValueClassName( JRDataSource.class.getName() ); 77 return expression; 78 } 79 } 80 81 84 public static class StringExpressionFactory extends JRBaseFactory { 85 public Object createObject( Attributes attrs ){ 86 JRDesignExpression expression = new JRDesignExpression(); 87 expression.setValueClassName( String .class.getName() ); 88 return expression; 89 } 90 } 91 92 95 public static class DateExpressionFactory extends JRBaseFactory { 96 public Object createObject( Attributes attrs ){ 97 JRDesignExpression expression = new JRDesignExpression(); 98 expression.setValueClassName( Date .class.getName() ); 99 return expression; 100 } 101 } 102 103 106 public static class ComparableExpressionFactory extends JRBaseFactory { 107 public Object createObject( Attributes attrs ){ 108 JRDesignExpression expression = new JRDesignExpression(); 109 expression.setValueClassName( Comparable .class.getName() ); 110 return expression; 111 } 112 } 113 114 117 public static class IntegerExpressionFactory extends JRBaseFactory { 118 public Object createObject( Attributes attrs ){ 119 JRDesignExpression expression = new JRDesignExpression(); 120 expression.setValueClassName( Integer .class.getName() ); 121 return expression; 122 } 123 } 124 125 128 public static class NumberExpressionFactory extends JRBaseFactory { 129 public Object createObject( Attributes attrs ){ 130 JRDesignExpression expression = new JRDesignExpression(); 131 expression.setValueClassName( Number .class.getName() ); 132 return expression; 133 } 134 } 135 136 139 public static class BooleanExpressionFactory extends JRBaseFactory { 140 public Object createObject( Attributes attrs ){ 141 JRDesignExpression expression = new JRDesignExpression(); 142 expression.setValueClassName( Boolean .class.getName() ); 143 return expression; 144 } 145 } 146 147 150 public static class MapExpressionFactory extends JRBaseFactory { 151 public Object createObject( Attributes attrs ){ 152 JRDesignExpression expression = new JRDesignExpression(); 153 expression.setValueClassName( Map .class.getName() ); 154 return expression; 155 } 156 } 157 158 public static class ComparatorExpressionFactory extends JRBaseFactory 159 { 160 public Object createObject(Attributes attrs) 161 { 162 JRDesignExpression expression = new JRDesignExpression(); 163 expression.setValueClassName(Comparator .class.getName()); 164 return expression; 165 } 166 } 167 168 } 169 | Popular Tags |