|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.krad.uif.util.ConstraintStateUtils
public class ConstraintStateUtils
Various utility methods for determining when to use constraints during states
Constructor Summary | |
---|---|
ConstraintStateUtils()
|
Method Summary | ||
---|---|---|
static boolean |
constraintAppliesForState(String applicableState,
Constraint constraint,
StateMapping stateMapping)
Determines if the constraint passed in applies for the applicableState, based on the stateMapping |
|
static
|
getApplicableConstraint(T constraint,
String validationState,
StateMapping stateMapping)
Gets the constraint that applies for the validationState passed in with the appropriate StateMapping (which should include validationState as one of its states). |
|
static String |
getClientViewValidationState(Object model,
View view)
Gets the client validation state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConstraintStateUtils()
Method Detail |
---|
public static boolean constraintAppliesForState(String applicableState, Constraint constraint, StateMapping stateMapping)
Note: this method will automatically return TRUE if the stateMapping is null, the Constraint is not a BaseConstraint, if there are no states defined on the Constraint, or if the state it applies to cannot be found in the stateMapping, because in all these cases the Constraint is considered stateless and will apply to any state
applicableState
- the state to check to see if the constraint appliesconstraint
- the Constraint to checkstateMapping
- the StateMapping object containing state information
public static <T extends Constraint> T getApplicableConstraint(T constraint, String validationState, StateMapping stateMapping)
This method will essentially return the constraint passed in, in most cases, if the constraint applies. In cases where there are constraintStateOverrides set for the constraint, those will be evaluated to get the appropriate replacement. If the constraint does not apply for the validationState (as well as none of the replacements), this method will return null. If stateMapping passed in is null, the constraint is not a BaseConstraint, or validationState is blank, the original constraint will be returned (assumed stateless).
T
- constraint typeconstraint
- the original constraintvalidationState
- the validation statestateMapping
- the state information for the model being evaluated
RuntimeException
- if the type of constraint passed in cannot be cast to the replacement constraintpublic static String getClientViewValidationState(Object model, View view)
model
- view
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |