net.sf.jasperreports.engine.design
Class JRDesignDataset

java.lang.Object
  extended bynet.sf.jasperreports.engine.base.JRBaseDataset
      extended bynet.sf.jasperreports.engine.design.JRDesignDataset
All Implemented Interfaces:
JRDataset, java.io.Serializable

public class JRDesignDataset
extends JRBaseDataset

Implementation of JRDataset to be used for report desing.

Version:
$Id: JRDesignDataset.java,v 1.7 2005/11/28 09:20:43 teodord Exp $
Author:
Lucian Chirita (lucianc@users.sourceforge.net)
See Also:
Serialized Form

Field Summary
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.
protected  java.util.List variablesList
           
protected  java.util.Map variablesMap
          Variables mapped by name.
 
Fields inherited from class net.sf.jasperreports.engine.base.JRBaseDataset
fields, groups, isMain, name, parameters, query, resourceBundle, scriptletClass, variables, whenResourceMissingType
 
Fields inherited from interface net.sf.jasperreports.engine.JRDataset
WHEN_RESOURCE_MISSING_TYPE_EMPTY, WHEN_RESOURCE_MISSING_TYPE_ERROR, WHEN_RESOURCE_MISSING_TYPE_KEY, WHEN_RESOURCE_MISSING_TYPE_NULL
 
Constructor Summary
JRDesignDataset(boolean isMain)
          Create a dataset.
 
Method Summary
 void addField(JRField field)
          Adds a field to the dataset.
 void addGroup(JRDesignGroup group)
          Adds a group to the dataset.
 void addParameter(JRParameter parameter)
          Adds a parameter to the dataset.
 void addVariable(JRDesignVariable variable)
          Adds a variable to the dataset.
 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.
 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.
 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.
 JRVariable removeVariable(JRVariable variable)
          Removes a variable from the dataset.
 JRVariable removeVariable(java.lang.String variableName)
          Removes a variable from the dataset.
 void setName(java.lang.String name)
          Sets the name of the dataset.
 void setQuery(JRQuery 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.
 
Methods inherited from class net.sf.jasperreports.engine.base.JRBaseDataset
getName, getQuery, getResourceBundle, getScriptletClass, getWhenResourceMissingType, isMainDataset, setWhenResourceMissingType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parametersMap

protected java.util.Map parametersMap
Parameters mapped by name.


parametersList

protected java.util.List parametersList

fieldsMap

protected java.util.Map fieldsMap
Fields mapped by name.


fieldsList

protected java.util.List fieldsList

variablesMap

protected java.util.Map variablesMap
Variables mapped by name.


variablesList

protected java.util.List variablesList

groupsMap

protected java.util.Map groupsMap
Groups mapped by name.


groupsList

protected java.util.List groupsList
Constructor Detail

JRDesignDataset

public JRDesignDataset(boolean isMain)
Create a dataset.

Parameters:
isMain - whether this is the main dataset of the report or a sub dataset
See Also:
JRDataset.isMainDataset()
Method Detail

setName

public void setName(java.lang.String name)
Sets the name of the dataset.

Parameters:
name - the name of the dataset
See Also:
JRDataset.getName()

getParameters

public JRParameter[] getParameters()
Description copied from interface: JRDataset
Returns the dataset's parameters.

Specified by:
getParameters in interface JRDataset
Overrides:
getParameters in class JRBaseDataset

getParametersList

public java.util.List getParametersList()
Returns the list of parameters, including build-in ones.

Returns:
list of JRParameter objects

getParametersMap

public java.util.Map getParametersMap()
Returns the map of parameters, including build-in ones, indexed by name.

Returns:
JRParameter objects indexed by name

addParameter

public void addParameter(JRParameter parameter)
                  throws JRException
Adds a parameter to the dataset.

Parameters:
parameter - the parameter to add
Throws:
JRException
See Also:
JRDataset.getParameters()

removeParameter

public JRParameter removeParameter(java.lang.String parameterName)
Removes a parameter from the dataset.

Parameters:
parameterName - the parameter name
Returns:
the removed parameter, or null if the parameter was not found

removeParameter

public JRParameter removeParameter(JRParameter parameter)
Removes a parameter from the dataset.

Parameters:
parameter - the parameter to be removed
Returns:
the parameter to be removed

setQuery

public void setQuery(JRQuery query)
Sets the dataset query.

Parameters:
query - the query
See Also:
JRDataset.getQuery()

setScriptletClass

public void setScriptletClass(java.lang.String scriptletClass)
Sets the scriptlet class name.

If no scriptlet class name is specified, a default scriptlet is used.

Parameters:
scriptletClass - the class name of the scriptlet
See Also:
JRDataset.getScriptletClass()

getFields

public JRField[] getFields()
Description copied from interface: JRDataset
Returns the dataset's fields.

Specified by:
getFields in interface JRDataset
Overrides:
getFields in class JRBaseDataset

getFieldsList

public java.util.List getFieldsList()
Returns the list of fields.

Returns:
list of JRField objects

getFieldsMap

public java.util.Map getFieldsMap()
Returns the map of fields indexed by name.

Returns:
JRField objects indexed by name

addField

public void addField(JRField field)
              throws JRException
Adds a field to the dataset.

Parameters:
field - the field to add
Throws:
JRException
See Also:
JRDataset.getFields()

removeField

public JRField removeField(java.lang.String fieldName)
Removes a field from the dataset.

Parameters:
fieldName - the field name
Returns:
the removed field, or null if the field was not found

removeField

public JRField removeField(JRField field)
Removes a field from the dataset.

Parameters:
field - the field to be removed
Returns:
the field to be removed

getVariables

public JRVariable[] getVariables()
Description copied from interface: JRDataset
Returns the dataset's variables.

Specified by:
getVariables in interface JRDataset
Overrides:
getVariables in class JRBaseDataset

getVariablesList

public java.util.List getVariablesList()
Returns the list of variables, including build-in ones.

Returns:
list of JRVariable objects

getVariablesMap

public java.util.Map getVariablesMap()
Returns the map of variable, including build-in ones, indexed by name.

Returns:
JRVariable objects indexed by name

addVariable

public void addVariable(JRDesignVariable variable)
                 throws JRException
Adds a variable to the dataset.

Parameters:
variable - the variable to add
Throws:
JRException
See Also:
JRDataset.getVariables()

removeVariable

public JRVariable removeVariable(java.lang.String variableName)
Removes a variable from the dataset.

Parameters:
variableName - the variable name
Returns:
the removed variable, or null if the variable was not found

removeVariable

public JRVariable removeVariable(JRVariable variable)
Removes a variable from the dataset.

Parameters:
variable - the variable to be removed
Returns:
the variable to be removed

getGroups

public JRGroup[] getGroups()
Description copied from interface: JRDataset
Returns the dataset's groups.

Specified by:
getGroups in interface JRDataset
Overrides:
getGroups in class JRBaseDataset

getGroupsList

public java.util.List getGroupsList()
Returns the list of groups.

Returns:
list of JRGroup objects

getGroupsMap

public java.util.Map getGroupsMap()
Returns the map of groups indexed by name.

Returns:
JRGroup objects indexed by name

addGroup

public void addGroup(JRDesignGroup group)
              throws JRException
Adds a group to the dataset.

Parameters:
group - the group to add
Throws:
JRException
See Also:
JRDataset.getGroups()

removeGroup

public JRGroup removeGroup(java.lang.String groupName)
Removes a group from the dataset.

Parameters:
groupName - the group name
Returns:
the removed group, or null if the group was not found

removeGroup

public JRGroup removeGroup(JRGroup group)
Removes a group from the dataset.

Parameters:
group - the group to be removed
Returns:
the group to be removed

setResourceBundle

public void setResourceBundle(java.lang.String resourceBundle)
Sets the base name of resource bundle to be used by the dataset.

Parameters:
resourceBundle - the resource bundle base name


© 2001-2005 JasperSoft Corporation www.jaspersoft.com