org.pentaho.platform.util
Class JVMParameterProvider

java.lang.Object
  extended by org.pentaho.platform.util.JVMParameterProvider
All Implemented Interfaces:
IParameterProvider

public class JVMParameterProvider
extends Object
implements IParameterProvider


Field Summary
 
Fields inherited from interface org.pentaho.platform.api.engine.IParameterProvider
SCOPE_REQUEST, SCOPE_SESSION
 
Constructor Summary
JVMParameterProvider()
           
 
Method Summary
 Object[] getArrayParameter(String name, Object[] defaultValue)
          Retrieve the requested parameter as an Object array
 Date getDateParameter(String name, Date defaultValue)
          Retrieve the requested parameter as type java.util.Date.
 BigDecimal getDecimalParameter(String name, BigDecimal defaultValue)
          Retrieve the requested parameter as decimal, returning a java.lang.Object.
 Object getDecimalParameter(String name, Object defaultValue)
           
 long getLongParameter(String name, long defaultValue)
          Retrieve the requested parameter as primitive Java type long.
 Object getParameter(String name)
          Gets the named parameter from the provider as it's native type
 Iterator getParameterNames()
          Return list of all avialable parameter names in this provider
 String getParameterType(String name)
           
 String[] getStringArrayParameter(String name, String[] defaultValue)
          Retrieve the requested parameter as a String array
 String getStringParameter(String name, String defaultValue)
          Retrieve the requested parameter as type java.lang.String
 boolean hasParameter(String name)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVMParameterProvider

public JVMParameterProvider()
Method Detail

getStringParameter

public String getStringParameter(String name,
                                 String defaultValue)
Description copied from interface: IParameterProvider
Retrieve the requested parameter as type java.lang.String

Specified by:
getStringParameter in interface IParameterProvider
Parameters:
name - name of parameter to retrieve
defaultValue - value to return if the named parameter can not be found
Returns:
value of requested parameter, or the defaultValue if not found

getLongParameter

public long getLongParameter(String name,
                             long defaultValue)
Description copied from interface: IParameterProvider
Retrieve the requested parameter as primitive Java type long.

Specified by:
getLongParameter in interface IParameterProvider
Parameters:
name - name of parameter to retrieve
defaultValue - value to return if the named parameter can not be found
Returns:
value of requested parameter, or the defaultValue if not found

hasParameter

public boolean hasParameter(String name)
Specified by:
hasParameter in interface IParameterProvider
Parameters:
name - Name of the parameter to look up
Returns:
true if the parameter exists in the parameter provider

getDateParameter

public Date getDateParameter(String name,
                             Date defaultValue)
Description copied from interface: IParameterProvider
Retrieve the requested parameter as type java.util.Date.

Specified by:
getDateParameter in interface IParameterProvider
Parameters:
name - name of parameter to retrieve
defaultValue - value to return if the named parameter can not be found
Returns:
value of requested parameter, or the defaultValue if not found

getDecimalParameter

public Object getDecimalParameter(String name,
                                  Object defaultValue)

getParameterNames

public Iterator getParameterNames()
Description copied from interface: IParameterProvider
Return list of all avialable parameter names in this provider

Specified by:
getParameterNames in interface IParameterProvider
Returns:
Set of parameter names

getParameterType

public String getParameterType(String name)

getParameter

public Object getParameter(String name)
Description copied from interface: IParameterProvider
Gets the named parameter from the provider as it's native type

Specified by:
getParameter in interface IParameterProvider
Parameters:
name - The name of the parameter to retrieve
Returns:
The native object

getDecimalParameter

public BigDecimal getDecimalParameter(String name,
                                      BigDecimal defaultValue)
Description copied from interface: IParameterProvider
Retrieve the requested parameter as decimal, returning a java.lang.Object.

Specified by:
getDecimalParameter in interface IParameterProvider
Parameters:
name - name of parameter to retrieve
defaultValue - value to return if the named parameter can not be found
Returns:
value of requested parameter, or the defaultValue if not found

getArrayParameter

public Object[] getArrayParameter(String name,
                                  Object[] defaultValue)
Description copied from interface: IParameterProvider
Retrieve the requested parameter as an Object array

Specified by:
getArrayParameter in interface IParameterProvider
Parameters:
name - name of parameter to retrieve
defaultValue - value to return if the named parameter can not be found
Returns:
value of requested parameter converted to an array if it wasn't already an array, or the defaultValue if not found

getStringArrayParameter

public String[] getStringArrayParameter(String name,
                                        String[] defaultValue)
Description copied from interface: IParameterProvider
Retrieve the requested parameter as a String array

Specified by:
getStringArrayParameter in interface IParameterProvider
Parameters:
name - name of parameter to retrieve
defaultValue - value to return if the named parameter can not be found
Returns:
value of requested parameter converted to a String array if it wasn't already a String array, or the defaultValue if not found