Package net.sf.jasperreports.engine.base
Class JRBaseDataset
- java.lang.Object
-
- net.sf.jasperreports.engine.base.JRBaseDataset
-
- All Implemented Interfaces:
Serializable,Cloneable,JRChangeEventsSupport,JRCloneable,JRDataset,JRIdentifiable,JRPropertiesHolder
- Direct Known Subclasses:
JRDesignDataset
public class JRBaseDataset extends Object implements JRDataset, Serializable, JRChangeEventsSupport
The base implementation ofJRDataset.- Author:
- Lucian Chirita (lucianc@users.sourceforge.net)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected JRField[]fieldsprotected JRExpressionfilterExpressionprotected JRGroup[]groupsprotected booleanisMainprotected Stringnameprotected JRParameter[]parametersprotected JRPropertiesMappropertiesMapstatic StringPROPERTY_WHEN_RESOURCE_MISSING_TYPEprotected JRQueryqueryprotected StringresourceBundleprotected StringscriptletClassprotected JRScriptlet[]scriptletsprotected JRSortField[]sortFieldsprotected UUIDuuidprotected JRVariable[]variablesprotected WhenResourceMissingTypeEnumwhenResourceMissingTypeValue
-
Constructor Summary
Constructors Modifier Constructor Description protectedJRBaseDataset(boolean isMain)protectedJRBaseDataset(JRDataset dataset, JRBaseObjectFactory factory)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()JRPropertyChangeSupportgetEventSupport()Returns the property change support object for this instance.JRField[]getFields()Returns the dataset's fields.JRExpressiongetFilterExpression()Returns the dataset filter expression.JRGroup[]getGroups()Returns the dataset's groups.StringgetName()Returns the dataset name.JRParameter[]getParameters()Returns the dataset's parameters.JRPropertiesHoldergetParentProperties()Returns the parent properties holder, whose properties are used as defaults for this object.JRPropertiesMapgetPropertiesMap()Returns this object's properties map.DatasetPropertyExpression[]getPropertyExpressions()Returns the list of dynamic/expression-based properties for this dataset.JRQuerygetQuery()Returns the query of the dataset.StringgetResourceBundle()Returns the resource bundle base name.StringgetScriptletClass()The name of the scriptlet class to be used when iterating this dataset.JRScriptlet[]getScriptlets()Returns the dataset's scriptlets.JRSortField[]getSortFields()Returns the dataset's sort fields.UUIDgetUUID()JRVariable[]getVariables()Returns the dataset's variables.WhenResourceMissingTypeEnumgetWhenResourceMissingTypeValue()Returns the resource missing handling type.booleanhasProperties()Checks whether the object has any properties.booleanisMainDataset()Decides whether this dataset is the main report dataset or a sub dataset.voidsetWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingTypeValue)Sets the resource missing handling type.
-
-
-
Field Detail
-
PROPERTY_WHEN_RESOURCE_MISSING_TYPE
public static final String PROPERTY_WHEN_RESOURCE_MISSING_TYPE
- See Also:
- Constant Field Values
-
isMain
protected final boolean isMain
-
uuid
protected UUID uuid
-
name
protected String name
-
scriptletClass
protected String scriptletClass
-
scriptlets
protected JRScriptlet[] scriptlets
-
parameters
protected JRParameter[] parameters
-
query
protected JRQuery query
-
fields
protected JRField[] fields
-
sortFields
protected JRSortField[] sortFields
-
variables
protected JRVariable[] variables
-
groups
protected JRGroup[] groups
-
resourceBundle
protected String resourceBundle
-
whenResourceMissingTypeValue
protected WhenResourceMissingTypeEnum whenResourceMissingTypeValue
-
propertiesMap
protected JRPropertiesMap propertiesMap
-
filterExpression
protected JRExpression filterExpression
-
-
Constructor Detail
-
JRBaseDataset
protected JRBaseDataset(boolean isMain)
-
JRBaseDataset
protected JRBaseDataset(JRDataset dataset, JRBaseObjectFactory factory)
-
-
Method Detail
-
getUUID
public UUID getUUID()
- Specified by:
getUUIDin interfaceJRIdentifiable
-
getName
public String getName()
Description copied from interface:JRDatasetReturns the dataset name.
-
getScriptletClass
public String getScriptletClass()
Description copied from interface:JRDatasetThe name of the scriptlet class to be used when iterating this dataset.- Specified by:
getScriptletClassin interfaceJRDataset- Returns:
- the scriplet class name
-
getQuery
public JRQuery getQuery()
Description copied from interface:JRDatasetReturns the query of the dataset.The query is used by passing a connection is passed to the dataset when instantiating.
-
getScriptlets
public JRScriptlet[] getScriptlets()
Description copied from interface:JRDatasetReturns the dataset's scriptlets.- Specified by:
getScriptletsin interfaceJRDataset- Returns:
- the dataset's scriptlets
-
getParameters
public JRParameter[] getParameters()
Description copied from interface:JRDatasetReturns the dataset's parameters.- Specified by:
getParametersin interfaceJRDataset- Returns:
- the dataset's parameters
-
getFields
public JRField[] getFields()
Description copied from interface:JRDatasetReturns the dataset's fields.
-
getSortFields
public JRSortField[] getSortFields()
Description copied from interface:JRDatasetReturns the dataset's sort fields.- Specified by:
getSortFieldsin interfaceJRDataset- Returns:
- the dataset's sort fields
-
getVariables
public JRVariable[] getVariables()
Description copied from interface:JRDatasetReturns the dataset's variables.- Specified by:
getVariablesin interfaceJRDataset- Returns:
- the dataset's variables
-
getGroups
public JRGroup[] getGroups()
Description copied from interface:JRDatasetReturns the dataset's groups.
-
isMainDataset
public boolean isMainDataset()
Description copied from interface:JRDatasetDecides whether this dataset is the main report dataset or a sub dataset.- Specified by:
isMainDatasetin interfaceJRDataset- Returns:
trueif and only if this dataset is the main report dataset
-
getResourceBundle
public String getResourceBundle()
Description copied from interface:JRDatasetReturns the resource bundle base name.The resource bundle is used when evaluating expressions.
- Specified by:
getResourceBundlein interfaceJRDataset- Returns:
- the resource bundle base name
-
getWhenResourceMissingTypeValue
public WhenResourceMissingTypeEnum getWhenResourceMissingTypeValue()
Description copied from interface:JRDatasetReturns the resource missing handling type.- Specified by:
getWhenResourceMissingTypeValuein interfaceJRDataset- Returns:
- the resource missing handling type
-
setWhenResourceMissingType
public void setWhenResourceMissingType(WhenResourceMissingTypeEnum whenResourceMissingTypeValue)
Description copied from interface:JRDatasetSets the resource missing handling type.- Specified by:
setWhenResourceMissingTypein interfaceJRDataset- Parameters:
whenResourceMissingTypeValue- the resource missing handling type
-
hasProperties
public boolean hasProperties()
Description copied from interface:JRPropertiesHolderChecks whether the object has any properties.- Specified by:
hasPropertiesin interfaceJRPropertiesHolder- Returns:
- whether the object has any properties
-
getPropertiesMap
public JRPropertiesMap getPropertiesMap()
Description copied from interface:JRPropertiesHolderReturns this object's properties map.- Specified by:
getPropertiesMapin interfaceJRPropertiesHolder- Returns:
- this object's properties map
-
getParentProperties
public JRPropertiesHolder getParentProperties()
Description copied from interface:JRPropertiesHolderReturns the parent properties holder, whose properties are used as defaults for this object.- Specified by:
getParentPropertiesin interfaceJRPropertiesHolder- Returns:
- the parent properties holder, or
nullif no parent
-
getPropertyExpressions
public DatasetPropertyExpression[] getPropertyExpressions()
Description copied from interface:JRDatasetReturns the list of dynamic/expression-based properties for this dataset.- Specified by:
getPropertyExpressionsin interfaceJRDataset- Returns:
- an array containing the expression-based properties of this dataset
-
getFilterExpression
public JRExpression getFilterExpression()
Description copied from interface:JRDatasetReturns the dataset filter expression.This expression is used to filter the rows of the
data sourcethat this dataset will iterate on.This expression (if not null) is evaluated immediately after a new row is
producedby the data source. The evaluation is performed using field and variable values corresponding to the new row. When the result of the evaluation isBoolean.TRUEthe row gets processed by the report filling engine. When the result is null orBoolean.FALSE, the current row will be skipped and the datasource will be asked for the next row.- Specified by:
getFilterExpressionin interfaceJRDataset- Returns:
- the dataset filter expression
-
clone
public Object clone()
- Specified by:
clonein interfaceJRCloneable- Overrides:
clonein classObject
-
getEventSupport
public JRPropertyChangeSupport getEventSupport()
Description copied from interface:JRChangeEventsSupportReturns the property change support object for this instance.- Specified by:
getEventSupportin interfaceJRChangeEventsSupport- Returns:
- the property change support object for this instance
-
-