org.kuali.rice.kns.service.impl
Class ParameterServiceBase

java.lang.Object
  extended by org.kuali.rice.kns.service.impl.ParameterServiceBase
All Implemented Interfaces:
ParameterService
Direct Known Subclasses:
ParameterServiceImpl

public abstract class ParameterServiceBase
extends Object
implements ParameterService

This is a description of what this class does - tom don't forget to fill this in.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected  DataDictionaryService dataDictionaryService
           
protected  KualiModuleService kualiModuleService
           
protected static String PARAMETER_CACHE_GROUP_NAME
           
protected static String PARAMETER_CACHE_PREFIX
           
 
Constructor Summary
ParameterServiceBase()
          This constructs a ...
 
Method Summary
 void clearCache()
          This method can be used to clear the parameter cache during unit testing.
private  boolean constraintIsAllow(Parameter parameter)
           
protected  Parameter fetchFromCache(String namespaceCode, String detailTypeCode, String name)
          Fetches the Parameter from the cache with the given parameter namespace and name.
protected  void flushParameterFromCache(String namespaceCode, String detailTypeCode, String name)
          Inserts the given Parameter into the cache.
 String getDetailType(Class documentOrStepClass)
          This method can be used to change the value of a Parameter for unit testing purposes.
protected  String getDetailTypeName(Class documentOrStepClass)
           
 boolean getIndicatorParameter(Class componentClass, String parameterName)
          This method provides a convenient way to access the value of indicator parameters with Y/N values.
 boolean getIndicatorParameter(String namespaceCode, String detailTypeCode, String parameterName)
          This method provides a convenient way to access the value of indicator parameters with Y/N values.
 String getNamespace(Class documentOrStepClass)
          This method can be used to set a namespace.
protected  Parameter getParameter(Class componentClass, String parameterName)
           
protected  Parameter getParameter(String namespaceCode, String detailTypeCode, String parameterName)
           
protected  String getParameterCacheKey(String namespaceCode, String detailTypeCode, String name)
          Returns the cache key for the given parameter.
protected  ParameterDetailType getParameterDetailType(Class documentOrStepClass)
           
 ParameterEvaluator getParameterEvaluator(Class componentClass, String parameterName)
          This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter.
 ParameterEvaluator getParameterEvaluator(Class componentClass, String parameterName, String constrainedValue)
          This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName, the values of the Parameter, the knowledge of whether the values are allowed or denied, and the constrainedValue.
 ParameterEvaluator getParameterEvaluator(Class componentClass, String parameterName, String constrainingValue, String constrainedValue)
          This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName, the values of the Parameter that correspond to the specified constrainingValue, the knowledge of whether the values are allowed or denied, and the constrainedValue.
 ParameterEvaluator getParameterEvaluator(Class componentClass, String allowParameterName, String denyParameterName, String constrainingValue, String constrainedValue)
          This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and allowParameterName or to the specified componentClass and denyParameterName (depending on which restricts based on the constraining value) or an instance of AlwaysSucceedParameterEvaluatorImpl if neither restricts, the values of the Parameter that correspond to the specified constrainingValue, the knowledge of whether the values are allowed or denied, and the constrainedValue.
protected  ParameterEvaluatorImpl getParameterEvaluator(Parameter parameter)
           
protected  ParameterEvaluatorImpl getParameterEvaluator(Parameter parameter, String constrainedValue)
           
protected  ParameterEvaluatorImpl getParameterEvaluator(Parameter parameter, String constrainingValue, String constrainedValue)
           
 ParameterEvaluator getParameterEvaluator(String namespaceCode, String detailTypeCode, String parameterName)
          This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter.
 ParameterEvaluator getParameterEvaluator(String namespaceCode, String detailTypeCode, String parameterName, String constrainedValue)
          This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter.
 String getParameterValue(Class componentClass, String parameterName)
          This method returns the unprocessed text value of a parameter.
 String getParameterValue(Class componentClass, String parameterName, String constrainingValue)
          This will look for constrainingValue= within the parameter text and return that if it is found.
 String getParameterValue(String namespaceCode, String detailTypeCode, String parameterName)
          This method returns the value of the specified parameter
 List<String> getParameterValues(Class componentClass, String parameterName)
          This method can be used to parse the value of a parameter by splitting on a semi-colon.
 List<String> getParameterValues(Class componentClass, String parameterName, String constrainingValue)
          This method looks for constrainingValue= within the parameter text and splits that text on a comma to generate the List to return.
private  List<String> getParameterValues(Parameter parameter)
           
protected  List<String> getParameterValues(Parameter parameter, String constrainingValue)
           
 List<String> getParameterValues(String namespaceCode, String detailTypeCode, String parameterName)
          This method can be used to parse the value of a parameter by splitting on a semi-colon.
private  Class getStepClass()
           
protected  void insertIntoCache(Parameter parameter)
          Inserts the given Parameter into the cache.
 boolean parameterExists(Class componentClass, String parameterName)
          This method provides an exception free way to ensure that a parameter exists.
 void setDataDictionaryService(DataDictionaryService dataDictionaryService)
           
 void setKualiModuleService(KualiModuleService kualiModuleService)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.kuali.rice.kns.service.ParameterService
retrieveParameter, retrieveParametersGivenLookupCriteria, setParameterForTesting
 

Field Detail

dataDictionaryService

protected DataDictionaryService dataDictionaryService

kualiModuleService

protected KualiModuleService kualiModuleService

PARAMETER_CACHE_PREFIX

protected static final String PARAMETER_CACHE_PREFIX
See Also:
Constant Field Values

PARAMETER_CACHE_GROUP_NAME

protected static final String PARAMETER_CACHE_GROUP_NAME
See Also:
Constant Field Values
Constructor Detail

ParameterServiceBase

public ParameterServiceBase()
This constructs a ...

Method Detail

parameterExists

public boolean parameterExists(Class componentClass,
                               String parameterName)
Description copied from interface: ParameterService
This method provides an exception free way to ensure that a parameter exists.

Specified by:
parameterExists in interface ParameterService
Returns:
boolean indicating whether or not the parameter exists
See Also:
org.kuali.kfs.sys.service.ParameterService#parameterExists(java.lang.Class componentClass, java.lang.String parameterName)

getIndicatorParameter

public boolean getIndicatorParameter(Class componentClass,
                                     String parameterName)
This method provides a convenient way to access the value of indicator parameters with Y/N values. Y is translated to true and N is translated to false.

Specified by:
getIndicatorParameter in interface ParameterService
Parameters:
componentClass -
parameterName -
Returns:
boolean value of Yes/No indicator parameter

getIndicatorParameter

public boolean getIndicatorParameter(String namespaceCode,
                                     String detailTypeCode,
                                     String parameterName)
This method provides a convenient way to access the value of indicator parameters with Y/N values. Y is translated to true and N is translated to false.

Specified by:
getIndicatorParameter in interface ParameterService
Parameters:
namespaceCode -
detailTypeCode -
parameterName -
Returns:
boolean value of Yes/No indicator parameter

getParameterValue

public String getParameterValue(Class componentClass,
                                String parameterName)
Description copied from interface: ParameterService
This method returns the unprocessed text value of a parameter.

Specified by:
getParameterValue in interface ParameterService
Returns:
unprocessed string value as a parameter
See Also:
org.kuali.kfs.sys.service.ParameterService#getParameterValue(java.lang.Class componentClass, java.lang.String parameterName)

getParameterValue

public String getParameterValue(String namespaceCode,
                                String detailTypeCode,
                                String parameterName)
Description copied from interface: ParameterService
This method returns the value of the specified parameter

Specified by:
getParameterValue in interface ParameterService
See Also:
org.kuali.kfs.sys.service.ParameterService#getParameterValue(java.lang.Class componentClass, java.lang.String parameterName)

getParameterValue

public String getParameterValue(Class componentClass,
                                String parameterName,
                                String constrainingValue)
This will look for constrainingValue= within the parameter text and return that if it is found. Otherwise, it will return null. Note, that if constrainingValue=value1,value2... (commas specific to the ParameterServiceImpl implementation) is found it will still return null, because calling this method states the assumption that there is only one value within the parameter text that corresponds to the constraining value.

Specified by:
getParameterValue in interface ParameterService
Parameters:
componentClass -
parameterName -
constrainingValue -
Returns:
derived value String or null

getParameterValues

public List<String> getParameterValues(Class componentClass,
                                       String parameterName)
This method can be used to parse the value of a parameter by splitting on a semi-colon.

Specified by:
getParameterValues in interface ParameterService
Parameters:
componentClass -
parameterName -
Returns:
parsed List of String parameter values

getParameterValues

public List<String> getParameterValues(String namespaceCode,
                                       String detailTypeCode,
                                       String parameterName)
This method can be used to parse the value of a parameter by splitting on a semi-colon.

Specified by:
getParameterValues in interface ParameterService
Parameters:
namespaceCode -
detailTypeCode -
parameterName -
Returns:
parsed List of String parameter values

getParameterValues

public List<String> getParameterValues(Class componentClass,
                                       String parameterName,
                                       String constrainingValue)
This method looks for constrainingValue= within the parameter text and splits that text on a comma to generate the List to return.

Specified by:
getParameterValues in interface ParameterService
Parameters:
componentClass -
parameterName -
constrainingValue -
Returns:
derived values List or an empty list if no values are found

getParameterEvaluator

public ParameterEvaluator getParameterEvaluator(Class componentClass,
                                                String parameterName)
This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter.

Specified by:
getParameterEvaluator in interface ParameterService
Parameters:
componentClass -
parameterName -
Returns:
ParameterEvaluator instance initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter

getParameterEvaluator

public ParameterEvaluator getParameterEvaluator(String namespaceCode,
                                                String detailTypeCode,
                                                String parameterName)
This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter.

Specified by:
getParameterEvaluator in interface ParameterService
Parameters:
namespaceCode -
detailTypeCode -
parameterName -
Returns:
ParameterEvaluator instance initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter

getParameterEvaluator

public ParameterEvaluator getParameterEvaluator(Class componentClass,
                                                String parameterName,
                                                String constrainedValue)
This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName, the values of the Parameter, the knowledge of whether the values are allowed or denied, and the constrainedValue.

Specified by:
getParameterEvaluator in interface ParameterService
Parameters:
componentClass -
parameterName -
Returns:
ParameterEvaluator instance initialized with the Parameter corresponding to the specified componentClass and parameterName, the values of the Parameter, the knowledge of whether the values are allowed or denied, and the constrainedValue

getParameterEvaluator

public ParameterEvaluator getParameterEvaluator(String namespaceCode,
                                                String detailTypeCode,
                                                String parameterName,
                                                String constrainedValue)
This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter.

Specified by:
getParameterEvaluator in interface ParameterService
Parameters:
namespaceCode -
detailTypeCode -
parameterName -
Returns:
ParameterEvaluator instance initialized with the Parameter corresponding to the specified componentClass and parameterName and the values of the Parameter

getParameterEvaluator

public ParameterEvaluator getParameterEvaluator(Class componentClass,
                                                String parameterName,
                                                String constrainingValue,
                                                String constrainedValue)
This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and parameterName, the values of the Parameter that correspond to the specified constrainingValue, the knowledge of whether the values are allowed or denied, and the constrainedValue.

Specified by:
getParameterEvaluator in interface ParameterService
Parameters:
componentClass -
parameterName -
Returns:
ParameterEvaluator instance initialized with the Parameter corresponding to the specified componentClass and parameterName, the values of the Parameter that correspond to the specified constrainingValue, the knowledge of whether the values are allowed or denied, and the constrainedValue

getParameterEvaluator

public ParameterEvaluator getParameterEvaluator(Class componentClass,
                                                String allowParameterName,
                                                String denyParameterName,
                                                String constrainingValue,
                                                String constrainedValue)
This method will return an instance of the parameterEvaluator bean defined in Spring, initialized with the Parameter corresponding to the specified componentClass and allowParameterName or to the specified componentClass and denyParameterName (depending on which restricts based on the constraining value) or an instance of AlwaysSucceedParameterEvaluatorImpl if neither restricts, the values of the Parameter that correspond to the specified constrainingValue, the knowledge of whether the values are allowed or denied, and the constrainedValue.

Specified by:
getParameterEvaluator in interface ParameterService
Parameters:
componentClass -
allowParameterName -
denyParameterName -
constrainingValue -
constrainedValue -
Returns:
AlwaysSucceedParameterEvaluatorImpl or ParameterEvaluator instance initialized with the Parameter that corresponds to the constrainingValue restriction, the values of the Parameter that correspond to the specified constrainingValue, the knowledge of whether the values are allowed or denied, and the constrainedValue

getNamespace

public String getNamespace(Class documentOrStepClass)
Description copied from interface: ParameterService
This method can be used to set a namespace.

Specified by:
getNamespace in interface ParameterService

getDetailType

public String getDetailType(Class documentOrStepClass)
Description copied from interface: ParameterService
This method can be used to change the value of a Parameter for unit testing purposes.

Specified by:
getDetailType in interface ParameterService

getStepClass

private Class getStepClass()

getDetailTypeName

protected String getDetailTypeName(Class documentOrStepClass)

getParameterEvaluator

protected ParameterEvaluatorImpl getParameterEvaluator(Parameter parameter)

getParameterEvaluator

protected ParameterEvaluatorImpl getParameterEvaluator(Parameter parameter,
                                                       String constrainedValue)

getParameterEvaluator

protected ParameterEvaluatorImpl getParameterEvaluator(Parameter parameter,
                                                       String constrainingValue,
                                                       String constrainedValue)

getParameterDetailType

protected ParameterDetailType getParameterDetailType(Class documentOrStepClass)

getParameterValues

protected List<String> getParameterValues(Parameter parameter,
                                          String constrainingValue)

getParameterValues

private List<String> getParameterValues(Parameter parameter)

clearCache

public void clearCache()
Description copied from interface: ParameterService
This method can be used to clear the parameter cache during unit testing.

Specified by:
clearCache in interface ParameterService
See Also:
org.kuali.kfs.sys.service.ParameterService#clearCache()

getParameter

protected Parameter getParameter(Class componentClass,
                                 String parameterName)

getParameter

protected Parameter getParameter(String namespaceCode,
                                 String detailTypeCode,
                                 String parameterName)

fetchFromCache

protected Parameter fetchFromCache(String namespaceCode,
                                   String detailTypeCode,
                                   String name)
Fetches the Parameter from the cache with the given parameter namespace and name. If there is no entry in the cache for the given namespace and name, null is returned.


insertIntoCache

protected void insertIntoCache(Parameter parameter)
Inserts the given Parameter into the cache. If the Parameter is already in the cache, these entries should be overwritten.


flushParameterFromCache

protected void flushParameterFromCache(String namespaceCode,
                                       String detailTypeCode,
                                       String name)
Inserts the given Parameter into the cache. If the Parameter is already in the cache, these entries should be overwritten.


getParameterCacheKey

protected String getParameterCacheKey(String namespaceCode,
                                      String detailTypeCode,
                                      String name)
Returns the cache key for the given parameter.


constraintIsAllow

private boolean constraintIsAllow(Parameter parameter)

setDataDictionaryService

public void setDataDictionaryService(DataDictionaryService dataDictionaryService)

setKualiModuleService

public void setKualiModuleService(KualiModuleService kualiModuleService)


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.