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 java.lang.ObjectDefines 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 java.lang.StringEXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUNDstatic java.lang.StringEXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUNDstatic java.lang.StringEXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUNDstatic java.lang.StringEXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLEprotected java.util.Map<java.lang.String,JRFillField>fieldsMapprotected JRFillGroup[]groupsprotected java.util.Map<java.lang.String,JRFillParameter>parametersMapprotected JRScriptletscriptletDefinitionprotected java.util.Map<java.lang.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(java.lang.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(java.lang.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 java.util.Map<java.lang.String,java.lang.Object>evaluateProperties(byte evaluation)java.lang.ObjectgetFieldValue(java.lang.String fieldName)java.lang.ObjectgetParameterValue(java.lang.String parameterName)java.lang.ObjectgetParameterValue(java.lang.String parameterName, boolean mustBeDeclared)java.lang.ObjectgetVariableValue(java.lang.String variableName)voidsetData(java.util.Map<java.lang.String,JRFillParameter> parsm, java.util.Map<java.lang.String,JRFillField> fldsm, java.util.Map<java.lang.String,JRFillVariable> varsm, JRFillGroup[] grps)Deprecated.Replaced bysetData(JRFillDataset).voidsetData(JRFillDataset dataset)voidsetScriptletDefinition(JRScriptlet scriptletDefinition)voidsetVariableValue(java.lang.String variableName, java.lang.Object value)
-
-
-
Field Detail
-
EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND
public static final java.lang.String EXCEPTION_MESSAGE_KEY_FIELD_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
public static final java.lang.String EXCEPTION_MESSAGE_KEY_PARAMETER_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND
public static final java.lang.String EXCEPTION_MESSAGE_KEY_VARIABLE_NOT_FOUND
- See Also:
- Constant Field Values
-
EXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLE
public static final java.lang.String EXCEPTION_MESSAGE_KEY_VARIABLE_VALUE_INCOMPATIBLE
- See Also:
- Constant Field Values
-
scriptletDefinition
protected JRScriptlet scriptletDefinition
-
dataset
protected JRFillDataset dataset
-
parametersMap
protected java.util.Map<java.lang.String,JRFillParameter> parametersMap
-
fieldsMap
protected java.util.Map<java.lang.String,JRFillField> fieldsMap
-
variablesMap
protected java.util.Map<java.lang.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(java.util.Map<java.lang.String,JRFillParameter> parsm, java.util.Map<java.lang.String,JRFillField> fldsm, java.util.Map<java.lang.String,JRFillVariable> varsm, JRFillGroup[] grps)
Deprecated.Replaced bysetData(JRFillDataset).
-
getParameterValue
public java.lang.Object getParameterValue(java.lang.String parameterName) throws JRScriptletException- Throws:
JRScriptletException
-
getParameterValue
public java.lang.Object getParameterValue(java.lang.String parameterName, boolean mustBeDeclared) throws JRScriptletException- Throws:
JRScriptletException
-
getFieldValue
public java.lang.Object getFieldValue(java.lang.String fieldName) throws JRScriptletException- Throws:
JRScriptletException
-
getVariableValue
public java.lang.Object getVariableValue(java.lang.String variableName) throws JRScriptletException- Throws:
JRScriptletException
-
setVariableValue
public void setVariableValue(java.lang.String variableName, java.lang.Object value) throws JRScriptletException- Throws:
JRScriptletException
-
evaluateProperties
protected java.util.Map<java.lang.String,java.lang.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(java.lang.String groupName) throws JRScriptletExceptionCalled before a group is initialized.- Parameters:
groupName- the group name- Throws:
JRScriptletException
-
afterGroupInit
public abstract void afterGroupInit(java.lang.String groupName) throws JRScriptletExceptionCalled 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
-
-