ar.com.fdvs.dj.util
Class ExpressionUtils

java.lang.Object
  extended by ar.com.fdvs.dj.util.ExpressionUtils

public class ExpressionUtils
extends Object


Constructor Summary
ExpressionUtils()
           
 
Method Summary
static net.sf.jasperreports.engine.design.JRDesignExpression createAndRegisterExpression(DynamicJasperDesign design, String name, CustomExpression expression)
           
static String createCustomExpressionInvocationText(CustomExpression customExpression, String customExpName)
          If you register a CustomExpression with the name "customExpName", then this will create the text needed to invoke it in a JRDesignExpression
static String createCustomExpressionInvocationText2(String customExpName)
          Same as regular, but instead of invoking directly $P{REPORT_SCRIPTLET}, it does through the $P{REPORT_PARAMETERS_MAP}
static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(net.sf.jasperreports.engine.design.JasperDesign jasperDesign, SubreportParameter sp)
           
static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(String text, Class clazz)
           
static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(String name, CustomExpression expression)
           
static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(String text, String className)
           
static String createParameterName(String preffix, Object obj)
           
static net.sf.jasperreports.engine.design.JRDesignExpression createStringExpression(String text)
           
static net.sf.jasperreports.engine.design.JRDesignExpression getConnectionExpression(DJDataSource ds)
           
static net.sf.jasperreports.engine.design.JRDesignExpression getDataSourceExpression(DJDataSource ds)
          Returns the expression string required
protected static String getDataSourceTypeStr(int datasourceType)
           
static net.sf.jasperreports.engine.design.JRDesignExpression getExpressionForConditionalStyle(ConditionalStyle condition, String columExpression)
           
static String getFieldsMapExpression(Collection columnsAndFields)
           
static String getInitialValueExpressionForOperation(DJCalculation calc, ColumnProperty prop)
           
static net.sf.jasperreports.engine.design.JRDesignExpression getParameterExpression(Subreport sr)
          Returns an expression that points to a java.util.Map object with the parameters to be used during the subreport fill time.
static String getParametersMapExpression()
           
static net.sf.jasperreports.engine.design.JRDesignExpression getReportConnectionExpression()
          Returns a JRDesignExpression that points to the main report connection
static String getTextForFieldsFromScriptlet()
           
static String getTextForParametersFromScriptlet()
           
static String getTextForVariablesFromScriptlet()
           
static String getValueClassNameForOperation(DJCalculation calc, ColumnProperty prop)
           
static String getVariablesMapExpression(Collection variables)
          Collection of JRVariable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionUtils

public ExpressionUtils()
Method Detail

getParameterExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression getParameterExpression(Subreport sr)
Returns an expression that points to a java.util.Map object with the parameters to be used during the subreport fill time. Posibilities are:
- Use Partent report Map
- Use a Map that is a parameter of the partents map
- Use a property of the current row.

Parameters:
sr -
Returns:

getDataSourceExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression getDataSourceExpression(DJDataSource ds)
Returns the expression string required

Parameters:
ds -
Returns:

getConnectionExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression getConnectionExpression(DJDataSource ds)

getReportConnectionExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression getReportConnectionExpression()
Returns a JRDesignExpression that points to the main report connection

Returns:

getDataSourceTypeStr

protected static String getDataSourceTypeStr(int datasourceType)

createStringExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression createStringExpression(String text)

createExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(String text,
                                                                                     Class clazz)

createExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(String text,
                                                                                     String className)

createExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(net.sf.jasperreports.engine.design.JasperDesign jasperDesign,
                                                                                     SubreportParameter sp)

createAndRegisterExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression createAndRegisterExpression(DynamicJasperDesign design,
                                                                                                String name,
                                                                                                CustomExpression expression)

createExpression

public static net.sf.jasperreports.engine.design.JRDesignExpression createExpression(String name,
                                                                                     CustomExpression expression)

getFieldsMapExpression

public static String getFieldsMapExpression(Collection columnsAndFields)
Parameters:
Collection - of ColumnProperty
Returns:

getVariablesMapExpression

public static String getVariablesMapExpression(Collection variables)
Collection of JRVariable

Parameters:
variables -
Returns:

getParametersMapExpression

public static String getParametersMapExpression()

createParameterName

public static String createParameterName(String preffix,
                                         Object obj)

createCustomExpressionInvocationText

public static String createCustomExpressionInvocationText(CustomExpression customExpression,
                                                          String customExpName)
If you register a CustomExpression with the name "customExpName", then this will create the text needed to invoke it in a JRDesignExpression

Parameters:
customExpName -
Returns:

createCustomExpressionInvocationText2

public static String createCustomExpressionInvocationText2(String customExpName)
Same as regular, but instead of invoking directly $P{REPORT_SCRIPTLET}, it does through the $P{REPORT_PARAMETERS_MAP}

Parameters:
customExpName -
Returns:

getTextForVariablesFromScriptlet

public static String getTextForVariablesFromScriptlet()

getTextForParametersFromScriptlet

public static String getTextForParametersFromScriptlet()

getTextForFieldsFromScriptlet

public static String getTextForFieldsFromScriptlet()

getValueClassNameForOperation

public static String getValueClassNameForOperation(DJCalculation calc,
                                                   ColumnProperty prop)

getInitialValueExpressionForOperation

public static String getInitialValueExpressionForOperation(DJCalculation calc,
                                                           ColumnProperty prop)

getExpressionForConditionalStyle

public static net.sf.jasperreports.engine.design.JRDesignExpression getExpressionForConditionalStyle(ConditionalStyle condition,
                                                                                                     String columExpression)


Copyright © 2006-2012 FDV Solutions. All Rights Reserved.