public class JRDesignDataset extends JRBaseDataset
JRDataset
to be used for report desing.Modifier and Type | Field and Description |
---|---|
protected java.util.List |
fieldsList |
protected java.util.Map |
fieldsMap
Fields mapped by name.
|
protected java.util.List |
groupsList |
protected java.util.Map |
groupsMap
Groups mapped by name.
|
protected java.util.List |
parametersList |
protected java.util.Map |
parametersMap
Parameters mapped by name.
|
static java.lang.String |
PROPERTY_FIELDS |
static java.lang.String |
PROPERTY_FILTER_EXPRESSION |
static java.lang.String |
PROPERTY_GROUPS |
static java.lang.String |
PROPERTY_NAME |
static java.lang.String |
PROPERTY_PARAMETERS |
static java.lang.String |
PROPERTY_QUERY |
static java.lang.String |
PROPERTY_RESOURCE_BUNDLE |
static java.lang.String |
PROPERTY_SCRIPTLET_CLASS |
static java.lang.String |
PROPERTY_SCRIPTLETS |
static java.lang.String |
PROPERTY_SORT_FIELDS |
static java.lang.String |
PROPERTY_VARIABLES |
protected java.util.List |
scriptletsList |
protected java.util.Map |
scriptletsMap
Scriptlets mapped by name.
|
protected java.util.List |
sortFieldsList |
protected java.util.Map |
sortFieldsMap
Sort fields mapped by name.
|
protected java.util.List |
variablesList |
protected java.util.Map |
variablesMap
Variables mapped by name.
|
fields, filterExpression, groups, isMain, name, parameters, propertiesMap, PROPERTY_WHEN_RESOURCE_MISSING_TYPE, query, resourceBundle, scriptletClass, scriptlets, sortFields, variables, whenResourceMissingTypeValue
WHEN_RESOURCE_MISSING_TYPE_EMPTY, WHEN_RESOURCE_MISSING_TYPE_ERROR, WHEN_RESOURCE_MISSING_TYPE_KEY, WHEN_RESOURCE_MISSING_TYPE_NULL
Constructor and Description |
---|
JRDesignDataset(boolean isMain)
Create a dataset.
|
Modifier and Type | Method and Description |
---|---|
void |
addField(int index,
JRField field)
Inserts a field at the specified position into the dataset.
|
void |
addField(JRField field)
Adds a field to the dataset.
|
void |
addGroup(int index,
JRDesignGroup group)
Inserts a group at the specified position into the dataset.
|
void |
addGroup(JRDesignGroup group)
Adds a group to the dataset.
|
void |
addParameter(int index,
JRParameter parameter)
Inserts a parameter at the specified position into the dataset.
|
void |
addParameter(JRParameter parameter)
Adds a parameter to the dataset.
|
void |
addScriptlet(int index,
JRScriptlet scriptlet)
Inserts a scriptlet at the specified position into the dataset.
|
void |
addScriptlet(JRScriptlet scriptlet)
Adds a scriptlet to the dataset.
|
void |
addSortField(int index,
JRSortField sortField)
Inserts a sort field at specified position into the dataset.
|
void |
addSortField(JRSortField sortField)
Adds a sort field to the dataset.
|
void |
addVariable(int index,
JRDesignVariable variable)
Inserts a variable at specified position into the dataset.
|
protected void |
addVariable(int index,
JRDesignVariable variable,
boolean system)
Inserts a variable at specified position into the dataset.
|
void |
addVariable(JRDesignVariable variable)
Adds a variable to the dataset.
|
protected void |
addVariable(JRDesignVariable variable,
boolean system)
Adds a variable to the dataset.
|
java.lang.Object |
clone() |
JRField[] |
getFields()
Returns the dataset's fields.
|
java.util.List |
getFieldsList()
Returns the list of fields.
|
java.util.Map |
getFieldsMap()
Returns the map of fields indexed by name.
|
JRGroup[] |
getGroups()
Returns the dataset's groups.
|
java.util.List |
getGroupsList()
Returns the list of groups.
|
java.util.Map |
getGroupsMap()
Returns the map of groups indexed by name.
|
JRParameter[] |
getParameters()
Returns the dataset's parameters.
|
java.util.List |
getParametersList()
Returns the list of parameters, including build-in ones.
|
java.util.Map |
getParametersMap()
Returns the map of parameters, including build-in ones, indexed by name.
|
JRScriptlet[] |
getScriptlets()
Returns the dataset's scriptlets.
|
java.util.List |
getScriptletsList()
Returns the list of scriptlets, excluding the scriptletClass one.
|
java.util.Map |
getScriptletsMap()
Returns the map of scriptlets, excluding the scriptletClass one, indexed by name.
|
JRSortField[] |
getSortFields()
Returns the dataset's sort fields.
|
java.util.List |
getSortFieldsList()
Returns the list of sort fields.
|
JRVariable[] |
getVariables()
Returns the dataset's variables.
|
java.util.List |
getVariablesList()
Returns the list of variables, including build-in ones.
|
java.util.Map |
getVariablesMap()
Returns the map of variable, including build-in ones, indexed by name.
|
protected void |
queryLanguageChanged(java.lang.String oldLanguage,
java.lang.String newLanguage) |
JRField |
removeField(JRField field)
Removes a field from the dataset.
|
JRField |
removeField(java.lang.String fieldName)
Removes a field from the dataset.
|
JRGroup |
removeGroup(JRGroup group)
Removes a group from the dataset.
|
JRGroup |
removeGroup(java.lang.String groupName)
Removes a group from the dataset.
|
JRParameter |
removeParameter(JRParameter parameter)
Removes a parameter from the dataset.
|
JRParameter |
removeParameter(java.lang.String parameterName)
Removes a parameter from the dataset.
|
JRScriptlet |
removeScriptlet(JRScriptlet scriptlet)
Removes a scriptlet from the dataset.
|
JRScriptlet |
removeScriptlet(java.lang.String scriptletName)
Removes a scriptlet from the dataset.
|
JRSortField |
removeSortField(JRSortField sortField)
Removes a sort field from the dataset.
|
JRSortField |
removeSortField(java.lang.String fieldName)
Removes a sort field from the dataset.
|
JRVariable |
removeVariable(JRVariable variable)
Removes a variable from the dataset.
|
JRVariable |
removeVariable(java.lang.String variableName)
Removes a variable from the dataset.
|
void |
setFilterExpression(JRExpression expression)
Sets the dataset filter expression.
|
void |
setName(java.lang.String name)
Sets the name of the dataset.
|
void |
setProperty(java.lang.String propName,
java.lang.String value)
Adds/sets a property value.
|
void |
setQuery(JRDesignQuery query)
Sets the dataset query.
|
void |
setResourceBundle(java.lang.String resourceBundle)
Sets the base name of resource bundle to be used by the dataset.
|
void |
setScriptletClass(java.lang.String scriptletClass)
Sets the scriptlet class name.
|
getEventSupport, getFilterExpression, getName, getParentProperties, getPropertiesMap, getQuery, getResourceBundle, getScriptletClass, getWhenResourceMissingType, getWhenResourceMissingTypeValue, hasProperties, isMainDataset, setWhenResourceMissingType, setWhenResourceMissingType
public static final java.lang.String PROPERTY_FIELDS
public static final java.lang.String PROPERTY_FILTER_EXPRESSION
public static final java.lang.String PROPERTY_GROUPS
public static final java.lang.String PROPERTY_NAME
public static final java.lang.String PROPERTY_SCRIPTLETS
public static final java.lang.String PROPERTY_PARAMETERS
public static final java.lang.String PROPERTY_QUERY
public static final java.lang.String PROPERTY_RESOURCE_BUNDLE
public static final java.lang.String PROPERTY_SCRIPTLET_CLASS
public static final java.lang.String PROPERTY_SORT_FIELDS
public static final java.lang.String PROPERTY_VARIABLES
protected java.util.Map scriptletsMap
protected java.util.List scriptletsList
protected java.util.Map parametersMap
protected java.util.List parametersList
protected java.util.Map fieldsMap
protected java.util.List fieldsList
protected java.util.Map sortFieldsMap
protected java.util.List sortFieldsList
protected java.util.Map variablesMap
protected java.util.List variablesList
protected java.util.Map groupsMap
protected java.util.List groupsList
public JRDesignDataset(boolean isMain)
isMain
- whether this is the main dataset of the report or a sub datasetJRDataset.isMainDataset()
public void setName(java.lang.String name)
name
- the name of the datasetJRDataset.getName()
public JRScriptlet[] getScriptlets()
JRDataset
getScriptlets
in interface JRDataset
getScriptlets
in class JRBaseDataset
public java.util.List getScriptletsList()
JRScriptlet
objectspublic java.util.Map getScriptletsMap()
JRScriptlet
objects indexed by namepublic void addScriptlet(JRScriptlet scriptlet) throws JRException
scriptlet
- the scriptlet to addJRException
JRDataset.getScriptlets()
public void addScriptlet(int index, JRScriptlet scriptlet) throws JRException
index
- the scriptlet positionscriptlet
- the scriptlet to insertJRException
JRDataset.getScriptlets()
public JRScriptlet removeScriptlet(java.lang.String scriptletName)
scriptletName
- the scriptlet namenull
if the scriptlet was not foundpublic JRScriptlet removeScriptlet(JRScriptlet scriptlet)
scriptlet
- the scriptlet to be removedpublic JRParameter[] getParameters()
JRDataset
getParameters
in interface JRDataset
getParameters
in class JRBaseDataset
public java.util.List getParametersList()
JRParameter
objectspublic java.util.Map getParametersMap()
JRParameter
objects indexed by namepublic void addParameter(JRParameter parameter) throws JRException
parameter
- the parameter to addJRException
JRDataset.getParameters()
public void addParameter(int index, JRParameter parameter) throws JRException
index
- the parameter positionparameter
- the parameter to insertJRException
JRDataset.getParameters()
public JRParameter removeParameter(java.lang.String parameterName)
parameterName
- the parameter namenull
if the parameter was not foundpublic JRParameter removeParameter(JRParameter parameter)
parameter
- the parameter to be removedpublic void setQuery(JRDesignQuery query)
query
- the queryJRDataset.getQuery()
public void setScriptletClass(java.lang.String scriptletClass)
If no scriptlet class name is specified, a default scriptlet is used.
scriptletClass
- the class name of the scriptletJRDataset.getScriptletClass()
public JRField[] getFields()
JRDataset
getFields
in interface JRDataset
getFields
in class JRBaseDataset
public java.util.List getFieldsList()
JRField
objectspublic java.util.Map getFieldsMap()
JRField
objects indexed by namepublic void addField(JRField field) throws JRException
field
- the field to addJRException
JRDataset.getFields()
public void addField(int index, JRField field) throws JRException
index
- the field positionfield
- the field to insertJRException
JRDataset.getFields()
public JRField removeField(java.lang.String fieldName)
fieldName
- the field namenull
if the field was not foundpublic JRField removeField(JRField field)
field
- the field to be removedpublic JRSortField[] getSortFields()
JRDataset
getSortFields
in interface JRDataset
getSortFields
in class JRBaseDataset
public java.util.List getSortFieldsList()
JRSortField
objectspublic void addSortField(JRSortField sortField) throws JRException
sortField
- the sort field to addJRException
JRDataset.getSortFields()
public void addSortField(int index, JRSortField sortField) throws JRException
index
- the sort field positionsortField
- the sort field to insertJRException
JRDataset.getSortFields()
public JRSortField removeSortField(java.lang.String fieldName)
fieldName
- the field namenull
if the sort field was not foundpublic JRSortField removeSortField(JRSortField sortField)
sortField
- the sort field to be removedpublic JRVariable[] getVariables()
JRDataset
getVariables
in interface JRDataset
getVariables
in class JRBaseDataset
public java.util.List getVariablesList()
JRVariable
objectspublic java.util.Map getVariablesMap()
JRVariable
objects indexed by namepublic void addVariable(JRDesignVariable variable) throws JRException
variable
- the variable to addJRException
JRDataset.getVariables()
public void addVariable(int index, JRDesignVariable variable) throws JRException
index
- the variable positionvariable
- the variable to insertJRException
JRDataset.getVariables()
protected void addVariable(JRDesignVariable variable, boolean system) throws JRException
variable
- the variable to addsystem
- whether the variable should be added before user defined variables
or at the end of the variables listJRException
protected void addVariable(int index, JRDesignVariable variable, boolean system) throws JRException
index
- the variable positionvariable
- the variable to insertsystem
- whether the variable should be inserted before user defined variables
or at the end of the variables listJRException
public JRVariable removeVariable(java.lang.String variableName)
variableName
- the variable namenull
if the variable was not foundpublic JRVariable removeVariable(JRVariable variable)
variable
- the variable to be removedpublic JRGroup[] getGroups()
JRDataset
getGroups
in interface JRDataset
getGroups
in class JRBaseDataset
public java.util.List getGroupsList()
JRGroup
objectspublic java.util.Map getGroupsMap()
JRGroup
objects indexed by namepublic void addGroup(JRDesignGroup group) throws JRException
group
- the group to addJRException
JRDataset.getGroups()
public void addGroup(int index, JRDesignGroup group) throws JRException
index
- the group positiongroup
- the group to insertJRException
JRDataset.getGroups()
public JRGroup removeGroup(java.lang.String groupName)
groupName
- the group namenull
if the group was not foundpublic JRGroup removeGroup(JRGroup group)
group
- the group to be removedpublic void setResourceBundle(java.lang.String resourceBundle)
resourceBundle
- the resource bundle base nameprotected void queryLanguageChanged(java.lang.String oldLanguage, java.lang.String newLanguage)
public void setProperty(java.lang.String propName, java.lang.String value)
propName
- the name of the propertyvalue
- the value of the propertypublic void setFilterExpression(JRExpression expression)
The expression value class should be java.lang.Boolean
.
expression
- the boolean expression to use as filter expressionJRDataset.getFilterExpression()
public java.lang.Object clone()
clone
in interface JRCloneable
clone
in class JRBaseDataset
© 2001-2010 Jaspersoft Corporation www.jaspersoft.com