org.pentaho.reporting.engine.classic.core.parameters
Class AbstractParameter

java.lang.Object
  extended by org.pentaho.reporting.engine.classic.core.parameters.AbstractParameter
All Implemented Interfaces:
Serializable, Cloneable, ParameterDefinitionEntry
Direct Known Subclasses:
DefaultListParameter, PlainParameter, StaticListParameter

public abstract class AbstractParameter
extends Object
implements ParameterDefinitionEntry

A simple parameter that represents a single value. This value is set by the user.

Author:
Thomas Morgner
See Also:
Serialized Form

Method Summary
 Object clone()
           
 Object getDefaultValue()
           
 Object getDefaultValue(ParameterContext context)
           
 String getName()
          The internal parameter name.
 String getParameterAttribute(String domain, String name)
           
 String getParameterAttribute(String domain, String name, ParameterContext parameterContext)
          Returns the parameter label.
 String[] getParameterAttributeNames(String domain)
           
 String[] getParameterAttributeNamespaces()
           
 String getRole()
           
 Class getValueType()
          Returns the parameter value type.
 boolean isDeprecated()
           
 boolean isHidden()
           
 boolean isMandatory()
          Provides a hint to the parameter validator, whether this value needs to have a selected value.
 void setDefaultValue(Object defaultValue)
           
 void setDeprecated(boolean deprecated)
           
 void setHidden(boolean hidden)
           
 void setMandatory(boolean mandatory)
           
 void setParameterAttribute(String domain, String name, String value)
           
 void setRole(String role)
           
 void setValueType(Class valueType)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
The internal parameter name. This will be the name of the data-row field by which the parameter's value can be accessed.

Specified by:
getName in interface ParameterDefinitionEntry
Returns:
the parameter name.

setParameterAttribute

public void setParameterAttribute(String domain,
                                  String name,
                                  String value)

getParameterAttribute

public String getParameterAttribute(String domain,
                                    String name)

getParameterAttribute

public String getParameterAttribute(String domain,
                                    String name,
                                    ParameterContext parameterContext)
Description copied from interface: ParameterDefinitionEntry
Returns the parameter label. This is optional, but provides a sensible default for auto-generated parameter pages.

Specified by:
getParameterAttribute in interface ParameterDefinitionEntry
Parameters:
domain - the parameter domain (namespace)
name - the name of the parameter attribute
parameterContext - the context from where to aquire the locale for the label.
Returns:
the label.

getParameterAttributeNamespaces

public String[] getParameterAttributeNamespaces()
Specified by:
getParameterAttributeNamespaces in interface ParameterDefinitionEntry

getParameterAttributeNames

public String[] getParameterAttributeNames(String domain)
Specified by:
getParameterAttributeNames in interface ParameterDefinitionEntry

isMandatory

public boolean isMandatory()
Provides a hint to the parameter validator, whether this value needs to have a selected value.

Specified by:
isMandatory in interface ParameterDefinitionEntry
Returns:
true, if the parameter must have a valid value, false otherwise.

setMandatory

public void setMandatory(boolean mandatory)

getValueType

public Class getValueType()
Returns the parameter value type. This is used to perform a simple validation on the incoming untrusted data and converts any incoming text value into a sensible default.

Specified by:
getValueType in interface ParameterDefinitionEntry
Returns:

setValueType

public void setValueType(Class valueType)

getDefaultValue

public Object getDefaultValue()

getDefaultValue

public Object getDefaultValue(ParameterContext context)
                       throws ReportDataFactoryException
Specified by:
getDefaultValue in interface ParameterDefinitionEntry
Throws:
ReportDataFactoryException

setDefaultValue

public void setDefaultValue(Object defaultValue)

clone

public Object clone()
             throws CloneNotSupportedException
Specified by:
clone in interface ParameterDefinitionEntry
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

isHidden

public boolean isHidden()

setHidden

public void setHidden(boolean hidden)

isDeprecated

public boolean isDeprecated()

setDeprecated

public void setDeprecated(boolean deprecated)

getRole

public String getRole()

setRole

public void setRole(String role)