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

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

public class RequiredAccountingLinesCountValidation
extends GenericValidation

GenericValidation to check if the required number of accounting lines in a given accounting line group has been met


Field Summary
protected  String accountingLineGroupPropertyName
           
protected  String errorMessageName
           
 
Constructor Summary
RequiredAccountingLinesCountValidation()
           
 
Method Summary
protected  String discoverGroupTitle(AccountingDocument document)
          Returns the title of the given accounting line group on the document
protected  Method discoverGroupTitleMethod(AccountingDocument document)
          Looks up what should be the method on the AccountingDocument class that returns the group title
 AccountingDocument getAccountingDocumentForValidation()
          Gets the accountingDocumentForValidation attribute.
 String getAccountingLineGroupName()
          Gets the accountingLineGroupName attribute.
 int getMinimumNumber()
          Gets the minimumNumber attribute.
 void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
          Sets the accountingDocumentForValidation attribute value.
 void setAccountingLineGroupName(String accountingLineGroupName)
          Sets the accountingLineGroupName attribute value.
 void setMinimumNumber(int minimumNumber)
          Sets the minimumNumber attribute value.
 boolean validate(AttributedDocumentEvent event)
          Checks that the number of accounting lines in the accounting line group (named by the accountingLineGroupPropertyName property) is greater than the set minimum number of accounting lines.
 
Methods inherited from class org.kuali.kfs.sys.document.validation.GenericValidation
setQuitOnFail, shouldQuitOnFail, stageValidation
 
Methods inherited from class org.kuali.kfs.sys.document.validation.ParameterizedValidation
getParameterProperties, populateParameterFromEvent, populateParametersFromEvent, setParameterProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accountingLineGroupPropertyName

protected String accountingLineGroupPropertyName

errorMessageName

protected String errorMessageName
Constructor Detail

RequiredAccountingLinesCountValidation

public RequiredAccountingLinesCountValidation()
Method Detail

validate

public boolean validate(AttributedDocumentEvent event)
Checks that the number of accounting lines in the accounting line group (named by the accountingLineGroupPropertyName property) is greater than the set minimum number of accounting lines. This validation expects the document to be sent in as a property.

Returns:
true if validation should continue, false otherwise
See Also:
org.kuali.kfs.sys.document.validation.GenericValidation#validate(java.lang.Object[])

discoverGroupTitle

protected String discoverGroupTitle(AccountingDocument document)
Returns the title of the given accounting line group on the document

Returns:
an accounting line group title

discoverGroupTitleMethod

protected Method discoverGroupTitleMethod(AccountingDocument document)
Looks up what should be the method on the AccountingDocument class that returns the group title

Returns:

getAccountingLineGroupName

public String getAccountingLineGroupName()
Gets the accountingLineGroupName attribute.

Returns:
Returns the accountingLineGroupName.

setAccountingLineGroupName

public void setAccountingLineGroupName(String accountingLineGroupName)
Sets the accountingLineGroupName attribute value.

Parameters:
accountingLineGroupName - The accountingLineGroupName to set.

getMinimumNumber

public int getMinimumNumber()
Gets the minimumNumber attribute.

Returns:
Returns the minimumNumber.

setMinimumNumber

public void setMinimumNumber(int minimumNumber)
Sets the minimumNumber attribute value.

Parameters:
minimumNumber - The minimumNumber to set.

getAccountingDocumentForValidation

public AccountingDocument getAccountingDocumentForValidation()
Gets the accountingDocumentForValidation attribute.

Returns:
Returns the accountingDocumentForValidation.

setAccountingDocumentForValidation

public void setAccountingDocumentForValidation(AccountingDocument accountingDocumentForValidation)
Sets the accountingDocumentForValidation attribute value.

Parameters:
accountingDocumentForValidation - The accountingDocumentForValidation to set.


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