org.kuali.kfs.sys.document.validation.impl
Class AccountingLineValuesAllowedValidationHutch

java.lang.Object
  extended by org.kuali.kfs.sys.document.validation.impl.AccountingLineValuesAllowedValidationHutch
All Implemented Interfaces:
Validation

public class AccountingLineValuesAllowedValidationHutch
extends Object
implements Validation

A cleaner way to conglomerate closely related rules together, this validation checks that all of the values on the accounting line are allowed by a given document. The advantage of this hutch over normal composites is that the hutch has "named slots" for given validations, which makes it a bit easier to keep track of everything.


Field Summary
protected  AccountingDocument accountingDocumentForValidation
           
protected  String accountingDocumentParameterPropertyName
           
protected  AccountingLine accountingLineForValidation
           
protected  String accountingLineParameterPropertyName
           
protected  Validation fundGroupAllowedValidation
           
protected  Validation objectCodeAllowedValidation
           
protected  Validation objectConsolidationAllowedValidation
           
protected  Validation objectLevelAllowedValidation
           
protected  Validation objectSubTypeAllowedValidation
           
protected  Validation objectTypeAllowedValidation
           
protected  boolean quitOnFail
           
protected  Validation subFundGroupAllowedValidation
           
 
Constructor Summary
AccountingLineValuesAllowedValidationHutch()
           
 
Method Summary
protected  void addParametersToValidation(AccountingLineValueAllowedValidation validation)
          Adds the parameter properties to an instance of the AccountingLinevAlueAllowedValidation
protected  void addParametersToValidation(CompositeValidation validation)
          Adds the parameter properties to the children validations of a CompositeValidation
 AccountingDocument getAccountingDocumentForValidation()
           
 String getAccountingDocumentParameterPropertyName()
          Gets the accountingDocumentParameterPropertyName attribute.
 AccountingLine getAccountingLineForValidation()
           
 String getAccountingLineParameterPropertyName()
          Gets the accountingLineParameterPropertyName attribute.
 Validation getFundGroupAllowedValidation()
          Gets the fundGroupAllowedValidation attribute.
 Validation getObjectCodeAllowedValidation()
          Gets the objectCodeAllowedValidation attribute.
 Validation getObjectConsolidationAllowedValidation()
          Gets the objectConsolidationAllowedValidation attribute.
 Validation getObjectLevelAllowedValidation()
          Gets the objectLevelAllowedValidation attribute.
 Validation getObjectSubTypeAllowedValidation()
          Gets the objectSubTypeAllowedValidation attribute.
 Validation getObjectTypeAllowedValidation()
          Gets the objectTypeAllowedValidation attribute.
 Validation getSubFundGroupAllowedValidation()
          Gets the subFundGroupAllowedValidation attribute.
protected  List<Validation> getValidationGauntlet()
          Returns a list of all the validations the hutch has to pass in order to pass as a whole.
protected  void grabDocumentAndLineForValidationFromEvent(AttributedDocumentEvent event)
          Using the parameter property names set, finds the accounting document and accounting line to be validate from the property, like an anteater getting tasty termites from a hill.
 void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
           
 void setAccountingDocumentParameterPropertyName(String accountingDocumentParameterPropertyName)
          Sets the accountingDocumentParameterPropertyName attribute value.
 void setAccountingLineForValidation(AccountingLine accountingLineForValidation)
           
 void setAccountingLineParameterPropertyName(String accountingLineParameterPropertyName)
          Sets the accountingLineParameterPropertyName attribute value.
 void setFundGroupAllowedValidation(Validation fundGroupAllowedValidation)
          Sets the fundGroupAllowedValidation attribute value.
 void setObjectCodeAllowedValidation(Validation objectCodeAllowedValidation)
          Sets the objectCodeAllowedValidation attribute value.
 void setObjectConsolidationAllowedValidation(Validation objectConsolidationAllowedValidation)
          Sets the objectConsolidationAllowedValidation attribute value.
 void setObjectLevelAllowedValidation(Validation objectLevelAllowedValidation)
          Sets the objectLevelAllowedValidation attribute value.
 void setObjectSubTypeAllowedValidation(Validation objectSubTypeAllowedValidation)
          Sets the objectSubTypeAllowedValidation attribute value.
 void setObjectTypeAllowedValidation(Validation objectTypeAllowedValidation)
          Sets the objectTypeAllowedValidation attribute value.
 void setQuitOnFail(boolean b)
          Sets whether the validation hutch should quit on the failure of the entire validation case failing.
 void setSubFundGroupAllowedValidation(Validation subFundGroupAllowedValidation)
          Sets the subFundGroupAllowedValidation 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
protected  void updateValidationsWithParameters()
          Goes through each of the validations in the hutch, making sure each has the accounting document and accounting line to validate
 boolean validate(AttributedDocumentEvent event)
          This method validates that certain parameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectCodeAllowedValidation

protected Validation objectCodeAllowedValidation

objectTypeAllowedValidation

protected Validation objectTypeAllowedValidation

fundGroupAllowedValidation

protected Validation fundGroupAllowedValidation

subFundGroupAllowedValidation

protected Validation subFundGroupAllowedValidation

objectSubTypeAllowedValidation

protected Validation objectSubTypeAllowedValidation

objectLevelAllowedValidation

protected Validation objectLevelAllowedValidation

objectConsolidationAllowedValidation

protected Validation objectConsolidationAllowedValidation

accountingDocumentParameterPropertyName

protected String accountingDocumentParameterPropertyName

accountingLineParameterPropertyName

protected String accountingLineParameterPropertyName

accountingDocumentForValidation

protected AccountingDocument accountingDocumentForValidation

accountingLineForValidation

protected AccountingLine accountingLineForValidation

quitOnFail

protected boolean quitOnFail
Constructor Detail

AccountingLineValuesAllowedValidationHutch

public AccountingLineValuesAllowedValidationHutch()
Method Detail

shouldQuitOnFail

public boolean shouldQuitOnFail()
Description copied from interface: Validation
Returns whether the validation process should quit on the failure of this validation

Specified by:
shouldQuitOnFail in interface Validation
Returns:
true if the validation process should quit, false otherwise
See Also:
Validation.shouldQuitOnFail()

setQuitOnFail

public void setQuitOnFail(boolean b)
Sets whether the validation hutch should quit on the failure of the entire validation case failing.

Parameters:
b -

stageValidation

public boolean stageValidation(AttributedDocumentEvent event)
Description copied from interface: Validation
Stages the execution of a Validation

Specified by:
stageValidation in interface Validation
Parameters:
event - the event the validate
Returns:
the boolean result of the staged Validation
See Also:
Validation.stageValidation(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)

getValidationGauntlet

protected List<Validation> getValidationGauntlet()
Returns a list of all the validations the hutch has to pass in order to pass as a whole.

Returns:
a List of Validations

grabDocumentAndLineForValidationFromEvent

protected void grabDocumentAndLineForValidationFromEvent(AttributedDocumentEvent event)
Using the parameter property names set, finds the accounting document and accounting line to be validate from the property, like an anteater getting tasty termites from a hill. Yummy.

Parameters:
event - the event to take properties from

updateValidationsWithParameters

protected void updateValidationsWithParameters()
Goes through each of the validations in the hutch, making sure each has the accounting document and accounting line to validate


addParametersToValidation

protected void addParametersToValidation(AccountingLineValueAllowedValidation validation)
Adds the parameter properties to an instance of the AccountingLinevAlueAllowedValidation

Parameters:
validation - the validation to add the correct properties to

addParametersToValidation

protected void addParametersToValidation(CompositeValidation validation)
Adds the parameter properties to the children validations of a CompositeValidation

Parameters:
validation - the validation to add the correct parameters to

validate

public boolean validate(AttributedDocumentEvent event)
Description copied from interface: Validation
This method validates that certain parameters

Specified by:
validate in interface Validation
Returns:
true if validation should continue, false otherwise
See Also:
Validation.validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)

getFundGroupAllowedValidation

public Validation getFundGroupAllowedValidation()
Gets the fundGroupAllowedValidation attribute.

Returns:
Returns the fundGroupAllowedValidation.

setFundGroupAllowedValidation

public void setFundGroupAllowedValidation(Validation fundGroupAllowedValidation)
Sets the fundGroupAllowedValidation attribute value.

Parameters:
fundGroupAllowedValidation - The fundGroupAllowedValidation to set.

getObjectCodeAllowedValidation

public Validation getObjectCodeAllowedValidation()
Gets the objectCodeAllowedValidation attribute.

Returns:
Returns the objectCodeAllowedValidation.

setObjectCodeAllowedValidation

public void setObjectCodeAllowedValidation(Validation objectCodeAllowedValidation)
Sets the objectCodeAllowedValidation attribute value.

Parameters:
objectCodeAllowedValidation - The objectCodeAllowedValidation to set.

getObjectConsolidationAllowedValidation

public Validation getObjectConsolidationAllowedValidation()
Gets the objectConsolidationAllowedValidation attribute.

Returns:
Returns the objectConsolidationAllowedValidation.

setObjectConsolidationAllowedValidation

public void setObjectConsolidationAllowedValidation(Validation objectConsolidationAllowedValidation)
Sets the objectConsolidationAllowedValidation attribute value.

Parameters:
objectConsolidationAllowedValidation - The objectConsolidationAllowedValidation to set.

getObjectLevelAllowedValidation

public Validation getObjectLevelAllowedValidation()
Gets the objectLevelAllowedValidation attribute.

Returns:
Returns the objectLevelAllowedValidation.

setObjectLevelAllowedValidation

public void setObjectLevelAllowedValidation(Validation objectLevelAllowedValidation)
Sets the objectLevelAllowedValidation attribute value.

Parameters:
objectLevelAllowedValidation - The objectLevelAllowedValidation to set.

getObjectSubTypeAllowedValidation

public Validation getObjectSubTypeAllowedValidation()
Gets the objectSubTypeAllowedValidation attribute.

Returns:
Returns the objectSubTypeAllowedValidation.

setObjectSubTypeAllowedValidation

public void setObjectSubTypeAllowedValidation(Validation objectSubTypeAllowedValidation)
Sets the objectSubTypeAllowedValidation attribute value.

Parameters:
objectSubTypeAllowedValidation - The objectSubTypeAllowedValidation to set.

getObjectTypeAllowedValidation

public Validation getObjectTypeAllowedValidation()
Gets the objectTypeAllowedValidation attribute.

Returns:
Returns the objectTypeAllowedValidation.

setObjectTypeAllowedValidation

public void setObjectTypeAllowedValidation(Validation objectTypeAllowedValidation)
Sets the objectTypeAllowedValidation attribute value.

Parameters:
objectTypeAllowedValidation - The objectTypeAllowedValidation to set.

getSubFundGroupAllowedValidation

public Validation getSubFundGroupAllowedValidation()
Gets the subFundGroupAllowedValidation attribute.

Returns:
Returns the subFundGroupAllowedValidation.

setSubFundGroupAllowedValidation

public void setSubFundGroupAllowedValidation(Validation subFundGroupAllowedValidation)
Sets the subFundGroupAllowedValidation attribute value.

Parameters:
subFundGroupAllowedValidation - The subFundGroupAllowedValidation to set.

getAccountingDocumentParameterPropertyName

public String getAccountingDocumentParameterPropertyName()
Gets the accountingDocumentParameterPropertyName attribute.

Returns:
Returns the accountingDocumentParameterPropertyName.

setAccountingDocumentParameterPropertyName

public void setAccountingDocumentParameterPropertyName(String accountingDocumentParameterPropertyName)
Sets the accountingDocumentParameterPropertyName attribute value.

Parameters:
accountingDocumentParameterPropertyName - The accountingDocumentParameterPropertyName to set.

getAccountingLineParameterPropertyName

public String getAccountingLineParameterPropertyName()
Gets the accountingLineParameterPropertyName attribute.

Returns:
Returns the accountingLineParameterPropertyName.

setAccountingLineParameterPropertyName

public void setAccountingLineParameterPropertyName(String accountingLineParameterPropertyName)
Sets the accountingLineParameterPropertyName attribute value.

Parameters:
accountingLineParameterPropertyName - The accountingLineParameterPropertyName to set.

setAccountingDocumentForValidation

public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)

setAccountingLineForValidation

public void setAccountingLineForValidation(AccountingLine accountingLineForValidation)

getAccountingDocumentForValidation

public AccountingDocument getAccountingDocumentForValidation()

getAccountingLineForValidation

public AccountingLine getAccountingLineForValidation()


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.