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 JRFillDatasetdatasetstatic StringEXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUNDstatic StringEXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUNDstatic StringEXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUNDstatic StringEXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLEprotected Map<String,JRFillField>fieldsMapprotected JRFillGroup[]groupsprotected Map<String,JRFillParameter>parametersMapprotected JRScriptletscriptletDefinitionprotected Map<String,JRFillVariable>variablesMap
-
Constructor Summary
Constructors Constructor Description JRAbstractScriptlet()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract voidafterColumnInit()Called after each column is initialized.abstract voidafterDetailEval()Called after evaluating each detail.abstract voidafterGroupInit(String groupName)Called after a group is initialized.abstract voidafterPageInit()Called after each page is initialized.abstract voidafterReportInit()Called after the report is initialized.abstract voidbeforeColumnInit()Called before each column is initialized.abstract voidbeforeDetailEval()Called before evaluating each detail.abstract voidbeforeGroupInit(String groupName)Called before a group is initialized.abstract voidbeforePageInit()Called before each page is initialized.abstract voidbeforeReportInit()Called before the report is initialized.voidcallAfterColumnInit()voidcallAfterDetailEval()voidcallAfterGroupInit()voidcallAfterPageInit()voidcallAfterReportInit()voidcallBeforeColumnInit()voidcallBeforeDetailEval()voidcallBeforeGroupInit()voidcallBeforePageInit()voidcallBeforeReportInit()protected Map<String,Object>evaluateProperties(byte evaluation)ObjectgetFieldValue(String fieldName)ObjectgetParameterValue(String parameterName)ObjectgetParameterValue(String parameterName, boolean mustBeDeclared)ObjectgetVariableValue(String variableName)voidsetData(Map<String,JRFillParameter> parsm, Map<String,JRFillField> fldsm, Map<String,JRFillVariable> varsm, JRFillGroup[] grps)Deprecated.Replaced bysetData(JRFillDataset).voidsetData(JRFillDataset dataset)voidsetScriptletDefinition(JRScriptlet scriptletDefinition)voidsetVariableValue(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)
-
setData
public void setData(Map<String,JRFillParameter> parsm, Map<String,JRFillField> fldsm, Map<String,JRFillVariable> varsm, JRFillGroup[] grps)
Deprecated.Replaced bysetData(JRFillDataset).
-
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 JRScriptletExceptionCalled before the report is initialized.- Throws:
JRScriptletException
-
afterReportInit
public abstract void afterReportInit() throws JRScriptletExceptionCalled after the report is initialized.- Throws:
JRScriptletException
-
beforePageInit
public abstract void beforePageInit() throws JRScriptletExceptionCalled before each page is initialized.- Throws:
JRScriptletException
-
afterPageInit
public abstract void afterPageInit() throws JRScriptletExceptionCalled after each page is initialized.- Throws:
JRScriptletException
-
beforeColumnInit
public abstract void beforeColumnInit() throws JRScriptletExceptionCalled before each column is initialized.- Throws:
JRScriptletException
-
afterColumnInit
public abstract void afterColumnInit() throws JRScriptletExceptionCalled 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 JRScriptletExceptionCalled before evaluating each detail.- Throws:
JRScriptletException
-
afterDetailEval
public abstract void afterDetailEval() throws JRScriptletExceptionCalled after evaluating each detail.- Throws:
JRScriptletException
-
-