net.sf.jasperreports.engine.design

## Class JRClassGenerator

- java.lang.Object
- - net.sf.jasperreports.engine.design.JRClassGenerator

-     public class JRClassGenerator
      extends java.lang.Object

  Version:
    $Id: JRClassGenerator.java 6936 2014-02-27 14:29:50Z lucianc $
  Author:
    Teodor Danciu (teodord@users.sourceforge.net)

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.String,JRField>` | `fieldsMap`
    `protected java.util.Map<java.lang.String,? extends JRParameter>` | `parametersMap`
    `static java.lang.String` | `PROPERTY_MAX_METHOD_SIZE`
    `protected static java.lang.String` | `SOURCE_EXPRESSION_ID_END`
    `protected static java.lang.String` | `SOURCE_EXPRESSION_ID_START`
    `protected static int` | `SOURCE_EXPRESSION_ID_START_LENGTH`
    `protected JRSourceCompileTask` | `sourceTask`
    `protected JRVariable[]` | `variables`
    `protected java.util.Map<java.lang.String,JRVariable>` | `variablesMap`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `JRClassGenerator(JRSourceCompileTask sourceTask)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addMethod(java.lang.StringBuffer methodBuffer, java.lang.reflect.Method method)`
    `protected void` | `appendExpressionComment(java.lang.StringBuffer sb, JRExpression expression)`
    `protected void` | `appendExpressionText(JRExpression expression, java.lang.StringBuffer sb, java.lang.String chunkText)`
    `protected JRCompilationSourceCode` | `generateClass()`
    `static JRCompilationSourceCode` | `generateClass(JRSourceCompileTask sourceTask)` Generates Java source code for evaluating the expressions of a report/dataset/crosstab.
    `protected void` | `generateClassStart(java.lang.StringBuffer sb)`
    `protected void` | `generateDeclarations(java.lang.StringBuffer sb)`
    `protected void` | `generateInitFieldsMethod(java.lang.StringBuffer sb)`
    `protected void` | `generateInitParamsMethod(java.lang.StringBuffer sb)`
    `protected void` | `generateInitVarsMethod(java.lang.StringBuffer sb)`
    `protected java.lang.String` | `generateMethod(byte evaluationType, java.util.List<JRExpression> expressionsList)`
    `protected JRExpression` | `getLineExpression(java.lang.String line)`
    `static JRCompilationSourceCode` | `modifySource(JRSourceCompileTask sourceTask, java.util.Set<java.lang.reflect.Method> missingMethods, java.lang.String sourceCode)`
    `protected JRCompilationSourceCode` | `modifySource(java.util.Set<java.lang.reflect.Method> missingMethods, java.lang.String sourceCode)`
    `protected JRDefaultCompilationSourceCode` | `parseSourceLines(java.lang.String sourceCode)`
    `protected void` | `writeExpression(java.lang.StringBuffer sb, JRExpression expression, byte evaluationType)`
    `protected void` | `writeMethodEnd(java.lang.StringBuffer sb, byte evaluationType, java.lang.Integer nextMethodIndex)`
    `protected void` | `writeMethodStart(java.lang.StringBuffer sb, byte evaluationType, int methodIndex)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROPERTY_MAX_METHOD_SIZE

          public static final java.lang.String PROPERTY_MAX_METHOD_SIZE

      See Also:
        Constant Field Values

    - #### SOURCE_EXPRESSION_ID_START

          protected static final java.lang.String SOURCE_EXPRESSION_ID_START

      See Also:
        Constant Field Values

    - #### SOURCE_EXPRESSION_ID_START_LENGTH

          protected static final int SOURCE_EXPRESSION_ID_START_LENGTH

    - #### SOURCE_EXPRESSION_ID_END

          protected static final java.lang.String SOURCE_EXPRESSION_ID_END

      See Also:
        Constant Field Values

    - #### sourceTask

          protected final JRSourceCompileTask sourceTask

    - #### parametersMap

          protected java.util.Map<java.lang.String,? extends JRParameter> parametersMap

    - #### fieldsMap

          protected java.util.Map<java.lang.String,JRField> fieldsMap

    - #### variablesMap

          protected java.util.Map<java.lang.String,JRVariable> variablesMap

    - #### variables

          protected JRVariable[] variables

  - ### Constructor Detail

    - #### JRClassGenerator

          protected JRClassGenerator(JRSourceCompileTask sourceTask)

  - ### Method Detail

    - #### generateClass

          public static JRCompilationSourceCode generateClass(JRSourceCompileTask sourceTask)
                                                       throws JRException

      Generates Java source code for evaluating the expressions of a report/dataset/crosstab.
      Parameters:
        `sourceTask` - the source task containing data required to generate the source file
      Returns:
        the source code
      Throws:
        `JRException`

    - #### modifySource

          public static JRCompilationSourceCode modifySource(JRSourceCompileTask sourceTask,
                                             java.util.Set<java.lang.reflect.Method> missingMethods,
                                             java.lang.String sourceCode)

    - #### generateClass

          protected JRCompilationSourceCode generateClass()
                                                   throws JRException

      Throws:
        `JRException`

    - #### generateClassStart

          protected final void generateClassStart(java.lang.StringBuffer sb)

    - #### generateDeclarations

          protected final void generateDeclarations(java.lang.StringBuffer sb)

    - #### generateInitParamsMethod

          protected final void generateInitParamsMethod(java.lang.StringBuffer sb)
                                                 throws JRException

      Throws:
        `JRException`

    - #### generateInitFieldsMethod

          protected final void generateInitFieldsMethod(java.lang.StringBuffer sb)
                                                 throws JRException

      Throws:
        `JRException`

    - #### generateInitVarsMethod

          protected final void generateInitVarsMethod(java.lang.StringBuffer sb)
                                               throws JRException

      Throws:
        `JRException`

    - #### generateMethod

          protected final java.lang.String generateMethod(byte evaluationType,
                                        java.util.List<JRExpression> expressionsList)
                                                   throws JRException

      Throws:
        `JRException`

    - #### writeMethodStart

          protected void writeMethodStart(java.lang.StringBuffer sb,
                              byte evaluationType,
                              int methodIndex)

    - #### writeExpression

          protected void writeExpression(java.lang.StringBuffer sb,
                             JRExpression expression,
                             byte evaluationType)

    - #### writeMethodEnd

          protected void writeMethodEnd(java.lang.StringBuffer sb,
                            byte evaluationType,
                            java.lang.Integer nextMethodIndex)

    - #### appendExpressionText

          protected void appendExpressionText(JRExpression expression,
                                  java.lang.StringBuffer sb,
                                  java.lang.String chunkText)

    - #### appendExpressionComment

          protected void appendExpressionComment(java.lang.StringBuffer sb,
                                     JRExpression expression)

    - #### parseSourceLines

          protected JRDefaultCompilationSourceCode parseSourceLines(java.lang.String sourceCode)

    - #### getLineExpression

          protected JRExpression getLineExpression(java.lang.String line)

    - #### modifySource

          protected JRCompilationSourceCode modifySource(java.util.Set<java.lang.reflect.Method> missingMethods,
                                             java.lang.String sourceCode)

    - #### addMethod

          protected void addMethod(java.lang.StringBuffer methodBuffer,
                       java.lang.reflect.Method method)

© 2001-2010 Jaspersoft Corporation www.jaspersoft.com