org.pentaho.platform.engine.services.actionsequence
Class ActionParameter

java.lang.Object
  extended by org.pentaho.platform.engine.services.actionsequence.ActionParameter
All Implemented Interfaces:
IActionParameter

public class ActionParameter
extends Object
implements IActionParameter


Field Summary
 
Fields inherited from interface org.pentaho.platform.api.engine.IActionParameter
PROMPT_ALLOWED, PROMPT_NEEDED, PROMPT_NEVER, PROMPT_PENDING, TYPE_CONTENT, TYPE_DATE, TYPE_DECIMAL, TYPE_INTEGER, TYPE_LIST, TYPE_OBJECT, TYPE_RESULT_SET, TYPE_STRING
 
Constructor Summary
ActionParameter(String name, String type, Object value, List variables, Object defaultValue)
           
 
Method Summary
 void addSaveLocation(String location)
           
 void dispose()
          See if we need to do any cleanup here
 String getName()
          Get the name, or the key for this ActionParameter.
 int getPromptStatus()
          Returns the prompt status for this parameter.
 int getPromptType()
           
 List getSaveLocations()
           
 String getSelectionDisplayName()
          The display name to use when building a prompt.
 String getSelectionNameForValue(String val)
          When building a parameter prompt page, what is the name of the prompt
 Map getSelectionNameMap()
           
 List getSelectionValues()
           
 String getStringValue()
          Get the value for this ActionParameter as type String.
 String getType()
          Return the value type as one of the constants available in this class.
 Object getValue()
          Get the value for this ActionParameter as a generic Java Object.
 List getValueAsList()
          Get the value for this ActionParameter as a java.util.List.
 org.pentaho.commons.connection.IPentahoResultSet getValueAsResultSet()
          Get the value for this ActionParameter as a IPentahoResultSet
 List getVariables()
           
 boolean hasDefaultValue()
          Check if this ActionParameter has a default value set.
 boolean hasSelections()
           
 boolean hasValue()
          Check to se if a value has been set for this parameter.
 boolean isDefaultValue()
          Check to see if the value returned from thisActionParameter is indeed the default value instead of a value that was set.
 boolean isNull()
          Check to see if the value (includes the default value) is null.
 boolean isOutputParameter()
           
 void setOutputParameter(boolean isOutputParameter)
           
 void setParamSelections(List selValues, Map selNames, String displayname)
          Deprecated.  
 boolean setPromptStatus(int status)
          Sets the prompt status for this parameter.
 void setValue(Object value)
          Sets the value object for this ActionParameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionParameter

public ActionParameter(String name,
                       String type,
                       Object value,
                       List variables,
                       Object defaultValue)
Method Detail

getSaveLocations

public List getSaveLocations()

addSaveLocation

public void addSaveLocation(String location)

getVariables

public List getVariables()
Specified by:
getVariables in interface IActionParameter
Returns:
List of where the parameter may come from (request, session, etc)

getName

public String getName()
Description copied from interface: IActionParameter
Get the name, or the key for this ActionParameter.

Specified by:
getName in interface IActionParameter
Returns:
the ActionParameter name

getType

public String getType()
Description copied from interface: IActionParameter
Return the value type as one of the constants available in this class.

Specified by:
getType in interface IActionParameter
Returns:
valid return values are TYPE_STRING, TYPE_INTEGER, TYPE_LIST, TYPE_CONTENT or TYPE_DATE

getStringValue

public String getStringValue()
Description copied from interface: IActionParameter
Get the value for this ActionParameter as type String.

Specified by:
getStringValue in interface IActionParameter
Returns:
the ActionParameter value as a String. getType() should be referenced first to be sure the value type is TYPE_STRING.

getValue

public Object getValue()
Description copied from interface: IActionParameter
Get the value for this ActionParameter as a generic Java Object.

Specified by:
getValue in interface IActionParameter
Returns:
the ActionParameter value as an Object

getValueAsList

public List getValueAsList()
Description copied from interface: IActionParameter
Get the value for this ActionParameter as a java.util.List.

Specified by:
getValueAsList in interface IActionParameter
Returns:
the ActionParameter value as a List. getType() should be referenced first to be sure the value type is TYPE_LIST.

getValueAsResultSet

public org.pentaho.commons.connection.IPentahoResultSet getValueAsResultSet()
Description copied from interface: IActionParameter
Get the value for this ActionParameter as a IPentahoResultSet

Specified by:
getValueAsResultSet in interface IActionParameter
Returns:
the IPentahoResultSet getType() should be referenced first to be sure the value type is TYPE_RESULT_SET.

setValue

public void setValue(Object value)
Description copied from interface: IActionParameter
Sets the value object for this ActionParameter.

Specified by:
setValue in interface IActionParameter
Parameters:
value - the value Object to be set.

hasDefaultValue

public boolean hasDefaultValue()
Description copied from interface: IActionParameter
Check if this ActionParameter has a default value set.

Specified by:
hasDefaultValue in interface IActionParameter
Returns:
true if there is a default value, otherwise false

hasValue

public boolean hasValue()
Description copied from interface: IActionParameter
Check to se if a value has been set for this parameter. Default value does not count;

Specified by:
hasValue in interface IActionParameter
Returns:
true if this parameter has a non default value

isDefaultValue

public boolean isDefaultValue()
Description copied from interface: IActionParameter
Check to see if the value returned from thisActionParameter is indeed the default value instead of a value that was set.

Specified by:
isDefaultValue in interface IActionParameter
Returns:
true if the parameter is using the default value, false otherwise

isNull

public boolean isNull()
Description copied from interface: IActionParameter
Check to see if the value (includes the default value) is null.

Specified by:
isNull in interface IActionParameter
Returns:
true if the value is null, otherwise false

dispose

public void dispose()
Description copied from interface: IActionParameter
See if we need to do any cleanup here

Specified by:
dispose in interface IActionParameter

getPromptType

public int getPromptType()

hasSelections

public boolean hasSelections()
Specified by:
hasSelections in interface IActionParameter

getSelectionDisplayName

public String getSelectionDisplayName()
Description copied from interface: IActionParameter
The display name to use when building a prompt.

Specified by:
getSelectionDisplayName in interface IActionParameter
Returns:
The display name for the prompt.

getSelectionNameForValue

public String getSelectionNameForValue(String val)
Description copied from interface: IActionParameter
When building a parameter prompt page, what is the name of the prompt

Specified by:
getSelectionNameForValue in interface IActionParameter
Returns:
name for the value

getSelectionValues

public List getSelectionValues()
Specified by:
getSelectionValues in interface IActionParameter

setParamSelections

@Deprecated
public void setParamSelections(List selValues,
                                          Map selNames,
                                          String displayname)
Deprecated. 

Unused

Specified by:
setParamSelections in interface IActionParameter

getSelectionNameMap

public Map getSelectionNameMap()
Specified by:
getSelectionNameMap in interface IActionParameter

getPromptStatus

public int getPromptStatus()
Description copied from interface: IActionParameter
Returns the prompt status for this parameter.

Specified by:
getPromptStatus in interface IActionParameter
Returns:
the status.
See Also:
IActionParameter.PROMPT_ALLOWED, IActionParameter.PROMPT_NEVER, IActionParameter.PROMPT_NEEDED, IActionParameter.PROMPT_PENDING

setPromptStatus

public boolean setPromptStatus(int status)
Description copied from interface: IActionParameter
Sets the prompt status for this parameter.

Specified by:
setPromptStatus in interface IActionParameter
Parameters:
status - The status to set.
Returns:
true if the set was successful or false if the current setting cannot be changed.
See Also:
IActionParameter.PROMPT_ALLOWED, IActionParameter.PROMPT_NEVER, IActionParameter.PROMPT_NEEDED, IActionParameter.PROMPT_PENDING

isOutputParameter

public boolean isOutputParameter()
Specified by:
isOutputParameter in interface IActionParameter
Returns:
Whether parameter should be displayed in output.

setOutputParameter

public void setOutputParameter(boolean isOutputParameter)