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

java.lang.Object
  extended by org.kuali.rice.kns.service.impl.AlwaysSucceedParameterEvaluatorImpl
All Implemented Interfaces:
Serializable, ParameterEvaluator

public class AlwaysSucceedParameterEvaluatorImpl
extends Object
implements ParameterEvaluator

This implementation of ParameterEvaluator is returned by ParameterServiceImpl when evaluation involves a constraining value and neither the allow nor deny parameter have restrictions for that value.

See Also:
Serialized Form

Field Summary
private static AlwaysSucceedParameterEvaluatorImpl instance
           
 
Constructor Summary
private AlwaysSucceedParameterEvaluatorImpl()
           
 
Method Summary
 boolean constraintIsAllow()
          This method determines whether the parameter lists allowed values or denied values.
 boolean evaluateAndAddError(Class businessObjectOrDocumentClass, String constrainedPropertyName)
          This method uses the evaluateAndAddError method.
 boolean evaluateAndAddError(Class businessObjectOrDocumentClass, String constrainedPropertyName, String userEditablePropertyName)
          This method uses the evaluationSucceeds method to evaluate the constrainedValue.
 boolean evaluationSucceeds()
          This method determines whether the constrainedValue specified when the ParameterEvaluator was created matches the parameter.
static ParameterEvaluator getInstance()
           
 String getName()
           
 String getParameterValuesForMessage()
          This method creates a pretty String representation of parameter values for the user messages.
 String getValue()
          This method returns the value of the correspnding Parameter.
 void setConstrainedValue(String constrainedValue)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static final AlwaysSucceedParameterEvaluatorImpl instance
Constructor Detail

AlwaysSucceedParameterEvaluatorImpl

private AlwaysSucceedParameterEvaluatorImpl()
Method Detail

getInstance

public static ParameterEvaluator getInstance()

constraintIsAllow

public boolean constraintIsAllow()
Description copied from interface: ParameterEvaluator
This method determines whether the parameter lists allowed values or denied values.

Specified by:
constraintIsAllow in interface ParameterEvaluator
Returns:
boolean indicating whether the parameter lists allowed values

evaluateAndAddError

public boolean evaluateAndAddError(Class businessObjectOrDocumentClass,
                                   String constrainedPropertyName,
                                   String userEditablePropertyName)
Description copied from interface: ParameterEvaluator
This method uses the evaluationSucceeds method to evaluate the constrainedValue. If evaluation does not succeed, it adds an error for the user. The businessObjectOrDocumentClass, nameOfConstrainedProperty and userEditablePropertyName are used by ParameterEvaluatorImpl to retrieve user friendly labels for the error message. The constrainedPropertyName corresponds to the field that has the value that the parameter is evaluating. The userEditablePropertyName corresponds to the field that has the value the user needs to correct to resolve the error. For example, the object type may be invalid, but the user needs to change the object code in order to remedy that.

Specified by:
evaluateAndAddError in interface ParameterEvaluator
Returns:
boolean indicating whether evaluation succeeded (see evaluationSucceeds)

evaluateAndAddError

public boolean evaluateAndAddError(Class businessObjectOrDocumentClass,
                                   String constrainedPropertyName)
Description copied from interface: ParameterEvaluator
This method uses the evaluateAndAddError method. It passes the constrainedPropertyName as both the constrainedPropertyName and the userEditablePropertyName, i.e. it should be used when they are one and the same.

Specified by:
evaluateAndAddError in interface ParameterEvaluator
Returns:
boolean indicating whether evaluation succeeded (see evaluationSucceeds)

evaluationSucceeds

public boolean evaluationSucceeds()
Description copied from interface: ParameterEvaluator
This method determines whether the constrainedValue specified when the ParameterEvaluator was created matches the parameter.

Specified by:
evaluationSucceeds in interface ParameterEvaluator
Returns:
boolean indicating whether the constrained value adheres to the restriction specified by the combination of the parameter constraint and the parameter value

getName

public String getName()

getParameterValuesForMessage

public String getParameterValuesForMessage()
Description copied from interface: ParameterEvaluator
This method creates a pretty String representation of parameter values for the user messages.

Specified by:
getParameterValuesForMessage in interface ParameterEvaluator
Returns:
user-friendly String representation of Parameter values

getValue

public String getValue()
Description copied from interface: ParameterEvaluator
This method returns the value of the correspnding Parameter.

Specified by:
getValue in interface ParameterEvaluator
Returns:
String value of underlying Parameter

setConstrainedValue

public void setConstrainedValue(String constrainedValue)


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