Class JRClassGenerator
java.lang.Object
net.sf.jasperreports.engine.design.JRClassGenerator
- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String, ? extends JRParameter> static final StringProperty that determines the maximum size of a generated Java methodprotected static final Stringprotected static final Stringprotected static final intprotected final JRSourceCompileTaskprotected JRVariable[]protected Map<String, JRVariable> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMethod(StringBuilder methodBuilder, Method method) protected voidappendExpressionComment(StringBuilder sb, JRExpression expression) protected voidappendExpressionText(JRExpression expression, StringBuilder sb, String chunkText) protected JRCompilationSourceCodestatic JRCompilationSourceCodegenerateClass(JRSourceCompileTask sourceTask) Generates Java source code for evaluating the expressions of a report/dataset/crosstab.protected final voidprotected final voidprotected final voidprotected final voidprotected final voidprotected final StringgenerateMethod(byte evaluationType, List<JRExpression> expressionsList) protected JRExpressiongetLineExpression(String line) protected JRCompilationSourceCodemodifySource(Set<Method> missingMethods, String sourceCode) static JRCompilationSourceCodemodifySource(JRSourceCompileTask sourceTask, Set<Method> missingMethods, String sourceCode) protected JRDefaultCompilationSourceCodeparseSourceLines(String sourceCode) protected voidwriteExpression(StringBuilder sb, JRExpression expression, byte evaluationType) protected voidwriteMethodEnd(StringBuilder sb, byte evaluationType, Integer nextMethodIndex) protected voidwriteMethodStart(StringBuilder sb, byte evaluationType, int methodIndex)
-
Field Details
-
PROPERTY_MAX_METHOD_SIZE
Property that determines the maximum size of a generated Java method- See Also:
-
SOURCE_EXPRESSION_ID_START
- See Also:
-
SOURCE_EXPRESSION_ID_START_LENGTH
protected static final int SOURCE_EXPRESSION_ID_START_LENGTH -
SOURCE_EXPRESSION_ID_END
- See Also:
-
sourceTask
-
parametersMap
-
fieldsMap
-
variablesMap
-
variables
-
-
Constructor Details
-
JRClassGenerator
-
-
Method Details
-
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, Set<Method> missingMethods, String sourceCode) -
generateClass
- Throws:
JRException
-
generateClassStart
-
generateDeclarations
-
generateInitParamsMethod
- Throws:
JRException
-
generateInitFieldsMethod
- Throws:
JRException
-
generateInitVarsMethod
- Throws:
JRException
-
generateMethod
protected final String generateMethod(byte evaluationType, List<JRExpression> expressionsList) throws JRException - Throws:
JRException
-
writeMethodStart
-
writeExpression
-
writeMethodEnd
-
appendExpressionText
-
appendExpressionComment
-
parseSourceLines
-
getLineExpression
-
modifySource
-
addMethod
-