Class AbstractParameter
- java.lang.Object
-
- 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
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractParameter(String name)
protected
AbstractParameter(String name, Class valueType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.reporting.engine.classic.core.parameters.ParameterDefinitionEntry
getTranslatedParameterAttribute
-
-
-
-
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 interfaceParameterDefinitionEntry
- Returns:
- the parameter 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 interfaceParameterDefinitionEntry
- Parameters:
domain
- the parameter domain (namespace)name
- the name of the parameter attributeparameterContext
- the context from where to aquire the locale for the label.- Returns:
- the label.
-
getParameterAttributeNamespaces
public String[] getParameterAttributeNamespaces()
- Specified by:
getParameterAttributeNamespaces
in interfaceParameterDefinitionEntry
-
getParameterAttributeNames
public String[] getParameterAttributeNames(String domain)
- Specified by:
getParameterAttributeNames
in interfaceParameterDefinitionEntry
-
isMandatory
public boolean isMandatory()
Provides a hint to the parameter validator, whether this value needs to have a selected value.- Specified by:
isMandatory
in interfaceParameterDefinitionEntry
- 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 interfaceParameterDefinitionEntry
- Returns:
-
setValueType
public void setValueType(Class valueType)
-
getDefaultValue
public Object getDefaultValue()
-
getDefaultValue
public Object getDefaultValue(ParameterContext context) throws ReportDataFactoryException
- Specified by:
getDefaultValue
in interfaceParameterDefinitionEntry
- Throws:
ReportDataFactoryException
-
setDefaultValue
public void setDefaultValue(Object defaultValue)
-
clone
public Object clone() throws CloneNotSupportedException
- Specified by:
clone
in interfaceParameterDefinitionEntry
- Overrides:
clone
in classObject
- 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)
-
-