|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.kuali.kfs.sys.document.validation.ParameterizedValidation
org.kuali.kfs.sys.document.validation.BranchingValidation
public abstract class BranchingValidation
An abstract class that creates an easy way to branch between validations. Basically, extenders set a branch map - a map where the key is the name of the branch and the value is the validation to perform to check on that branch. Extenders also implement the determineBranch method, which returns the name of the branch to validate against; if null is returned, then no validation will occur.
Field Summary | |
---|---|
protected Map<String,Validation> |
branchMap
|
protected List<ValidationFieldConvertible> |
parameterProperties
|
protected boolean |
shouldQuitOnFail
|
Constructor Summary | |
---|---|
BranchingValidation()
|
Method Summary | |
---|---|
protected abstract String |
determineBranch(AttributedDocumentEvent event)
Determines which branch, if any, within the branchMap should be used as the validation to take. |
Map<String,Validation> |
getBranchMap()
Gets the branchMap attribute. |
List<ValidationFieldConvertible> |
getParameterProperties()
Note: these parameter properties only help determine what branching should take place; these properties will not affect in anyway the branch children |
void |
setBranchMap(Map<String,Validation> branchMap)
Sets the branchMap attribute value. |
void |
setParameterProperties(List<ValidationFieldConvertible> parameterProperties)
Sets the parameterProperties attribute value. |
void |
setShouldQuitOnFail(boolean shouldQuitOnFail)
Sets the shouldQuitOnFail attribute value. |
boolean |
shouldQuitOnFail()
Returns whether the validation process should quit on the failure of this validation |
boolean |
stageValidation(AttributedDocumentEvent event)
Stages the execution of a Validation |
boolean |
validate(AttributedDocumentEvent event)
Using the branch name returned by determineBranch(), validates the event against the corresponding branch in the branch map. |
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation |
---|
populateParameterFromEvent, populateParametersFromEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Map<String,Validation> branchMap
protected List<ValidationFieldConvertible> parameterProperties
protected boolean shouldQuitOnFail
Constructor Detail |
---|
public BranchingValidation()
Method Detail |
---|
protected abstract String determineBranch(AttributedDocumentEvent event)
event
- the event which triggered this validation
public List<ValidationFieldConvertible> getParameterProperties()
getParameterProperties
in class ParameterizedValidation
org.kuali.kfs.sys.document.validation.Validation#getParameterProperties()
public void setParameterProperties(List<ValidationFieldConvertible> parameterProperties)
setParameterProperties
in class ParameterizedValidation
parameterProperties
- The parameterProperties to set.public boolean shouldQuitOnFail()
Validation
shouldQuitOnFail
in interface Validation
Validation.shouldQuitOnFail()
public void setShouldQuitOnFail(boolean shouldQuitOnFail)
shouldQuitOnFail
- The shouldQuitOnFail to set.public boolean stageValidation(AttributedDocumentEvent event)
Validation
stageValidation
in interface Validation
event
- the event the validate
Validation.stageValidation(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)
public boolean validate(AttributedDocumentEvent event)
validate
in interface Validation
Validation.validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)
public Map<String,Validation> getBranchMap()
public void setBranchMap(Map<String,Validation> branchMap)
branchMap
- The branchMap to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |