Package net.sf.jasperreports.engine
Class JRAbstractScriptlet
- java.lang.Object
-
- net.sf.jasperreports.engine.JRAbstractScriptlet
-
- Direct Known Subclasses:
JRDefaultScriptlet
,JRFillDatasetScriptlet
public abstract class JRAbstractScriptlet extends Object
Defines an abstract representation of a report scriptlet. Scriptlets are useful when a specific behavior is needed in certain moments of the report filling process, such as report, column or group initialization. Scriptlets must implement the abstract methods that define the behavior at the specified moments.- Author:
- Teodor Danciu (teodord@users.sourceforge.net)
-
-
Field Summary
Fields Modifier and Type Field Description protected JRFillDataset
dataset
static String
EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND
static String
EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
static String
EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND
static String
EXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLE
protected Map<String,JRFillField>
fieldsMap
protected JRFillGroup[]
groups
protected Map<String,JRFillParameter>
parametersMap
protected JRScriptlet
scriptletDefinition
protected Map<String,JRFillVariable>
variablesMap
-
Constructor Summary
Constructors Constructor Description JRAbstractScriptlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
afterColumnInit()
Called after each column is initialized.abstract void
afterDetailEval()
Called after evaluating each detail.abstract void
afterGroupInit(String groupName)
Called after a group is initialized.abstract void
afterPageInit()
Called after each page is initialized.abstract void
afterReportInit()
Called after the report is initialized.abstract void
beforeColumnInit()
Called before each column is initialized.abstract void
beforeDetailEval()
Called before evaluating each detail.abstract void
beforeGroupInit(String groupName)
Called before a group is initialized.abstract void
beforePageInit()
Called before each page is initialized.abstract void
beforeReportInit()
Called before the report is initialized.void
callAfterColumnInit()
void
callAfterDetailEval()
void
callAfterGroupInit()
void
callAfterPageInit()
void
callAfterReportInit()
void
callBeforeColumnInit()
void
callBeforeDetailEval()
void
callBeforeGroupInit()
void
callBeforePageInit()
void
callBeforeReportInit()
protected Map<String,Object>
evaluateProperties(byte evaluation)
Object
getFieldValue(String fieldName)
Object
getParameterValue(String parameterName)
Object
getParameterValue(String parameterName, boolean mustBeDeclared)
Object
getVariableValue(String variableName)
void
setData(JRFillDataset dataset)
void
setScriptletDefinition(JRScriptlet scriptletDefinition)
void
setVariableValue(String variableName, Object value)
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND
public static final String EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLE
public static final String EXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLE
- See Also:
- Constant Field Values
-
scriptletDefinition
protected JRScriptlet scriptletDefinition
-
dataset
protected JRFillDataset dataset
-
parametersMap
protected Map<String,JRFillParameter> parametersMap
-
fieldsMap
protected Map<String,JRFillField> fieldsMap
-
variablesMap
protected Map<String,JRFillVariable> variablesMap
-
groups
protected JRFillGroup[] groups
-
-
Method Detail
-
setScriptletDefinition
public void setScriptletDefinition(JRScriptlet scriptletDefinition)
-
setData
public void setData(JRFillDataset dataset)
-
getParameterValue
public Object getParameterValue(String parameterName) throws JRScriptletException
- Throws:
JRScriptletException
-
getParameterValue
public Object getParameterValue(String parameterName, boolean mustBeDeclared) throws JRScriptletException
- Throws:
JRScriptletException
-
getFieldValue
public Object getFieldValue(String fieldName) throws JRScriptletException
- Throws:
JRScriptletException
-
getVariableValue
public Object getVariableValue(String variableName) throws JRScriptletException
- Throws:
JRScriptletException
-
setVariableValue
public void setVariableValue(String variableName, Object value) throws JRScriptletException
- Throws:
JRScriptletException
-
evaluateProperties
protected Map<String,Object> evaluateProperties(byte evaluation) throws JRException
- Throws:
JRException
-
callBeforeReportInit
public void callBeforeReportInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callAfterReportInit
public void callAfterReportInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callBeforePageInit
public void callBeforePageInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callAfterPageInit
public void callAfterPageInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callBeforeColumnInit
public void callBeforeColumnInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callAfterColumnInit
public void callAfterColumnInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callBeforeGroupInit
public void callBeforeGroupInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callAfterGroupInit
public void callAfterGroupInit() throws JRScriptletException
- Throws:
JRScriptletException
-
callBeforeDetailEval
public void callBeforeDetailEval() throws JRScriptletException
- Throws:
JRScriptletException
-
callAfterDetailEval
public void callAfterDetailEval() throws JRScriptletException
- Throws:
JRScriptletException
-
beforeReportInit
public abstract void beforeReportInit() throws JRScriptletException
Called before the report is initialized.- Throws:
JRScriptletException
-
afterReportInit
public abstract void afterReportInit() throws JRScriptletException
Called after the report is initialized.- Throws:
JRScriptletException
-
beforePageInit
public abstract void beforePageInit() throws JRScriptletException
Called before each page is initialized.- Throws:
JRScriptletException
-
afterPageInit
public abstract void afterPageInit() throws JRScriptletException
Called after each page is initialized.- Throws:
JRScriptletException
-
beforeColumnInit
public abstract void beforeColumnInit() throws JRScriptletException
Called before each column is initialized.- Throws:
JRScriptletException
-
afterColumnInit
public abstract void afterColumnInit() throws JRScriptletException
Called after each column is initialized.- Throws:
JRScriptletException
-
beforeGroupInit
public abstract void beforeGroupInit(String groupName) throws JRScriptletException
Called before a group is initialized.- Parameters:
groupName
- the group name- Throws:
JRScriptletException
-
afterGroupInit
public abstract void afterGroupInit(String groupName) throws JRScriptletException
Called after a group is initialized.- Parameters:
groupName
- the group name- Throws:
JRScriptletException
-
beforeDetailEval
public abstract void beforeDetailEval() throws JRScriptletException
Called before evaluating each detail.- Throws:
JRScriptletException
-
afterDetailEval
public abstract void afterDetailEval() throws JRScriptletException
Called after evaluating each detail.- Throws:
JRScriptletException
-
-