public class JRDesignDataset extends JRBaseDataset
JRDataset to be used for report design.fields, filterExpression, groups, isMain, name, parameters, propertiesMap, PROPERTY_WHEN_RESOURCE_MISSING_TYPE, query, resourceBundle, scriptletClass, scriptlets, sortFields, uuid, variables, whenResourceMissingTypeValue| Constructor and Description |
|---|
JRDesignDataset(boolean isMain)
Create a dataset.
|
JRDesignDataset(JasperReportsContext jasperReportsContext,
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.
|
Object |
clone() |
JRField[] |
getFields()
Returns the dataset's fields.
|
List<JRField> |
getFieldsList()
Returns the list of fields.
|
Map<String,JRField> |
getFieldsMap()
Returns the map of fields indexed by name.
|
JRGroup[] |
getGroups()
Returns the dataset's groups.
|
List<JRGroup> |
getGroupsList()
Returns the list of groups.
|
Map<String,JRGroup> |
getGroupsMap()
Returns the map of groups indexed by name.
|
JRParameter[] |
getParameters()
Returns the dataset's parameters.
|
List<JRParameter> |
getParametersList()
Returns the list of parameters, including build-in ones.
|
Map<String,JRParameter> |
getParametersMap()
Returns the map of parameters, including build-in ones, indexed by name.
|
JRScriptlet[] |
getScriptlets()
Returns the dataset's scriptlets.
|
List<JRScriptlet> |
getScriptletsList()
Returns the list of scriptlets, excluding the scriptletClass one.
|
Map<String,JRScriptlet> |
getScriptletsMap()
Returns the map of scriptlets, excluding the scriptletClass one, indexed by name.
|
JRSortField[] |
getSortFields()
Returns the dataset's sort fields.
|
List<JRSortField> |
getSortFieldsList()
Returns the list of sort fields.
|
Map<String,JRSortField> |
getSortFieldsMap()
Returns the map of sort fields indexed by name and type.
|
JRVariable[] |
getVariables()
Returns the dataset's variables.
|
List<JRVariable> |
getVariablesList()
Returns the list of variables, including build-in ones.
|
Map<String,JRVariable> |
getVariablesMap()
Returns the map of variable, including build-in ones, indexed by name.
|
boolean |
hasUUID()
Determines whether the report has an existing unique identifier.
|
protected void |
queryLanguageChanged(String oldLanguage,
String newLanguage) |
JRField |
removeField(JRField field)
Removes a field from the dataset.
|
JRField |
removeField(String fieldName)
Removes a field from the dataset.
|
JRGroup |
removeGroup(JRGroup group)
Removes a group from the dataset.
|
JRGroup |
removeGroup(String groupName)
Removes a group from the dataset.
|
JRParameter |
removeParameter(JRParameter parameter)
Removes a parameter from the dataset.
|
JRParameter |
removeParameter(String parameterName)
Removes a parameter from the dataset.
|
JRScriptlet |
removeScriptlet(JRScriptlet scriptlet)
Removes a scriptlet from the dataset.
|
JRScriptlet |
removeScriptlet(String scriptletName)
Removes a scriptlet from the dataset.
|
JRSortField |
removeSortField(JRSortField sortField)
Removes a sort field from the dataset.
|
JRSortField |
removeSortField(String fieldName)
Deprecated.
To be removed.
|
JRVariable |
removeVariable(JRVariable variable)
Removes a variable from the dataset.
|
JRVariable |
removeVariable(String variableName)
Removes a variable from the dataset.
|
void |
setFilterExpression(JRExpression expression)
Sets the dataset filter expression.
|
void |
setName(String name)
Sets the name of the dataset.
|
void |
setProperty(String propName,
String value)
Adds/sets a property value.
|
void |
setQuery(JRDesignQuery query)
Sets the dataset query.
|
void |
setResourceBundle(String resourceBundle)
Sets the base name of resource bundle to be used by the dataset.
|
void |
setScriptletClass(String scriptletClass)
Sets the scriptlet class name.
|
void |
setUUID(UUID uuid)
Sets the unique identifier for the report.
|
getEventSupport, getFilterExpression, getName, getParentProperties, getPropertiesMap, getQuery, getResourceBundle, getScriptletClass, getUUID, getWhenResourceMissingTypeValue, hasProperties, isMainDataset, setWhenResourceMissingTypepublic static final String EXCEPTION_MESSAGE_KEY_DUPLICATE_GROUP
public static final String EXCEPTION_MESSAGE_KEY_DUPLICATE_FIELD
public static final String EXCEPTION_MESSAGE_KEY_DUPLICATE_PARAMETER
public static final String EXCEPTION_MESSAGE_KEY_DUPLICATE_SCRIPTLET
public static final String EXCEPTION_MESSAGE_KEY_DUPLICATE_SORT_FIELD
public static final String EXCEPTION_MESSAGE_KEY_DUPLICATE_VARIABLE
public static final String EXCEPTION_MESSAGE_KEY_UNKNOWN_BUILTIN_PARAMETER_TYPE
public static final String PROPERTY_FIELDS
public static final String PROPERTY_FILTER_EXPRESSION
public static final String PROPERTY_GROUPS
public static final String PROPERTY_NAME
public static final String PROPERTY_SCRIPTLETS
public static final String PROPERTY_PARAMETERS
public static final String PROPERTY_QUERY
public static final String PROPERTY_RESOURCE_BUNDLE
public static final String PROPERTY_SCRIPTLET_CLASS
public static final String PROPERTY_SORT_FIELDS
public static final String PROPERTY_VARIABLES
protected Map<String,JRScriptlet> scriptletsMap
protected List<JRScriptlet> scriptletsList
protected Map<String,JRParameter> parametersMap
protected List<JRParameter> parametersList
protected Map<String,JRSortField> sortFieldsMap
protected List<JRSortField> sortFieldsList
protected Map<String,JRVariable> variablesMap
protected List<JRVariable> variablesList
public JRDesignDataset(boolean isMain)
isMain - whether this is the main dataset of the report or a sub datasetJRDataset.isMainDataset()public JRDesignDataset(JasperReportsContext jasperReportsContext, boolean isMain)
isMain - whether this is the main dataset of the report or a sub datasetJRDataset.isMainDataset()public void setUUID(UUID uuid)
uuid - the identifierpublic boolean hasUUID()
JRBaseDataset.getUUID() would generate and return
an identifier.setUUID(UUID)public void setName(String name)
name - the name of the datasetJRDataset.getName()public JRScriptlet[] getScriptlets()
JRDatasetgetScriptlets in interface JRDatasetgetScriptlets in class JRBaseDatasetpublic List<JRScriptlet> getScriptletsList()
JRScriptlet objectspublic Map<String,JRScriptlet> getScriptletsMap()
JRScriptlet objects indexed by namepublic void addScriptlet(JRScriptlet scriptlet) throws JRException
scriptlet - the scriptlet to addJRExceptionJRDataset.getScriptlets()public void addScriptlet(int index,
JRScriptlet scriptlet)
throws JRException
index - the scriptlet positionscriptlet - the scriptlet to insertJRExceptionJRDataset.getScriptlets()public JRScriptlet removeScriptlet(String scriptletName)
scriptletName - the scriptlet namenull if the scriptlet was not foundpublic JRScriptlet removeScriptlet(JRScriptlet scriptlet)
scriptlet - the scriptlet to be removedpublic JRParameter[] getParameters()
JRDatasetgetParameters in interface JRDatasetgetParameters in class JRBaseDatasetpublic List<JRParameter> getParametersList()
JRParameter objectspublic Map<String,JRParameter> getParametersMap()
JRParameter objects indexed by namepublic void addParameter(JRParameter parameter) throws JRException
parameter - the parameter to addJRExceptionJRDataset.getParameters()public void addParameter(int index,
JRParameter parameter)
throws JRException
index - the parameter positionparameter - the parameter to insertJRExceptionJRDataset.getParameters()public JRParameter removeParameter(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(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()
JRDatasetgetFields in interface JRDatasetgetFields in class JRBaseDatasetpublic List<JRField> getFieldsList()
JRField objectspublic Map<String,JRField> getFieldsMap()
JRField objects indexed by namepublic void addField(JRField field) throws JRException
field - the field to addJRExceptionJRDataset.getFields()public void addField(int index,
JRField field)
throws JRException
index - the field positionfield - the field to insertJRExceptionJRDataset.getFields()public JRField removeField(String fieldName)
fieldName - the field namenull if the field was not foundpublic JRField removeField(JRField field)
field - the field to be removedpublic JRSortField[] getSortFields()
JRDatasetgetSortFields in interface JRDatasetgetSortFields in class JRBaseDatasetpublic List<JRSortField> getSortFieldsList()
JRSortField objectspublic Map<String,JRSortField> getSortFieldsMap()
JRField objects indexed by namepublic void addSortField(JRSortField sortField) throws JRException
sortField - the sort field to addJRExceptionJRDataset.getSortFields()public void addSortField(int index,
JRSortField sortField)
throws JRException
index - the sort field positionsortField - the sort field to insertJRExceptionJRDataset.getSortFields()public JRSortField removeSortField(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()
JRDatasetgetVariables in interface JRDatasetgetVariables in class JRBaseDatasetpublic List<JRVariable> getVariablesList()
JRVariable objectspublic Map<String,JRVariable> getVariablesMap()
JRVariable objects indexed by namepublic void addVariable(JRDesignVariable variable) throws JRException
variable - the variable to addJRExceptionJRDataset.getVariables()public void addVariable(int index,
JRDesignVariable variable)
throws JRException
index - the variable positionvariable - the variable to insertJRExceptionJRDataset.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 listJRExceptionprotected 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 listJRExceptionpublic JRVariable removeVariable(String variableName)
variableName - the variable namenull if the variable was not foundpublic JRVariable removeVariable(JRVariable variable)
variable - the variable to be removedpublic JRGroup[] getGroups()
JRDatasetgetGroups in interface JRDatasetgetGroups in class JRBaseDatasetpublic List<JRGroup> getGroupsList()
JRGroup objectspublic Map<String,JRGroup> getGroupsMap()
JRGroup objects indexed by namepublic void addGroup(JRDesignGroup group) throws JRException
group - the group to addJRExceptionJRDataset.getGroups()public void addGroup(int index,
JRDesignGroup group)
throws JRException
index - the group positiongroup - the group to insertJRExceptionJRDataset.getGroups()public JRGroup removeGroup(String groupName)
groupName - the group namenull if the group was not foundpublic JRGroup removeGroup(JRGroup group)
group - the group to be removedpublic void setResourceBundle(String resourceBundle)
resourceBundle - the resource bundle base namepublic void setProperty(String propName, 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 Object clone()
clone in interface JRCloneableclone in class JRBaseDatasetCopyright © 2017. All rights reserved.