org.kuali.kfs.sys.document.service.impl
Class AccountingDocumentRuleHelperServiceImpl

java.lang.Object
  extended by org.kuali.kfs.sys.document.service.impl.AccountingDocumentRuleHelperServiceImpl
All Implemented Interfaces:
AccountingDocumentRuleHelperService

public class AccountingDocumentRuleHelperServiceImpl
extends Object
implements AccountingDocumentRuleHelperService

The default implementation of the AccountingDocumentRuleHelperService


Constructor Summary
AccountingDocumentRuleHelperServiceImpl()
           
 
Method Summary
 String formatProperty(String propertyName, Object... arguments)
          Gets the named property from KualiConfigurationService (i.e., from ApplicationResources.properties) and formats it with the given arguments (if any).
protected  String getLabelFromDataDictionary(Class entryClass, String attributeName)
          Looks up a label from the data dictionary
 String getObjectCodeTypeCodeWithoutSideEffects(GeneralLedgerPendingEntrySourceDetail postable)
          Makes sure that the objectCode attribute is fully populated b/c we are using proxying in our persistence layer.
 boolean isExpense(GeneralLedgerPendingEntrySourceDetail postable)
          Check object code type to determine whether the accounting line is expense.
 boolean isIncome(GeneralLedgerPendingEntrySourceDetail postable)
          Determines whether an accounting line is an income line or not.
 boolean isValidBalanceType(BalanceType balanceType, Class entryClass, String attributeName, String errorPropertyName)
          This method checks for the existence of the provided balance type, in the system and also checks to see if it is active.
 boolean isValidBalanceType(BalanceType balanceType, String errorPropertyName)
          This method checks for the existence of the provided balance type, in the system and also checks to see if it is active.
 boolean isValidOpenAccountingPeriod(AccountingPeriod accountingPeriod, Class entryClass, String attribueName, String errorPropertyName)
          This method checks for the existence of the accounting period in the system and also makes sure that the accounting period is open for posting.
 boolean isValidReversalDate(Date reversalDate, String errorPropertyName)
          Some documents have reversal dates.
 void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService ddService)
          Sets the dataDictionaryService attribute value.
 void setObjectTypeService(ObjectTypeService objectTypeService)
          Sets the objectTypeService attribute value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountingDocumentRuleHelperServiceImpl

public AccountingDocumentRuleHelperServiceImpl()
Method Detail

isExpense

public boolean isExpense(GeneralLedgerPendingEntrySourceDetail postable)
Description copied from interface: AccountingDocumentRuleHelperService
Check object code type to determine whether the accounting line is expense.

Specified by:
isExpense in interface AccountingDocumentRuleHelperService
Returns:
boolean True if the line is an expense line.
See Also:
AccountingDocumentRuleHelperService.isExpense(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail)

isIncome

public boolean isIncome(GeneralLedgerPendingEntrySourceDetail postable)
Description copied from interface: AccountingDocumentRuleHelperService
Determines whether an accounting line is an income line or not. This goes agains the configurable object type code list in the ApplicationParameter mechanism. This list can be configured externally.

Specified by:
isIncome in interface AccountingDocumentRuleHelperService
Returns:
boolean True if the line is an income line.
See Also:
AccountingDocumentRuleHelperService.isIncome(org.kuali.kfs.sys.businessobject.GeneralLedgerPendingEntrySourceDetail)

getObjectCodeTypeCodeWithoutSideEffects

public String getObjectCodeTypeCodeWithoutSideEffects(GeneralLedgerPendingEntrySourceDetail postable)
Makes sure that the objectCode attribute is fully populated b/c we are using proxying in our persistence layer.

Specified by:
getObjectCodeTypeCodeWithoutSideEffects in interface AccountingDocumentRuleHelperService
Parameters:
accountingLine -
Returns:
the object type code of the object code of the given accounting line

isValidBalanceType

public boolean isValidBalanceType(BalanceType balanceType,
                                  String errorPropertyName)
Description copied from interface: AccountingDocumentRuleHelperService
This method checks for the existence of the provided balance type, in the system and also checks to see if it is active.

Specified by:
isValidBalanceType in interface AccountingDocumentRuleHelperService
errorPropertyName - also used as the BalanceTyp DD attribute name
Returns:
True if the balance type is valid, false otherwise.
See Also:
org.kuali.kfs.sys.document.service.AccountingDocumentRuleHelperService#isValidBalanceType(org.kuali.kfs.coa.businessobject.BalanceTyp, java.lang.String)

getLabelFromDataDictionary

protected String getLabelFromDataDictionary(Class entryClass,
                                            String attributeName)
Looks up a label from the data dictionary

Parameters:
entryClass - the class of the attribute to lookup the label for
attributeName - the attribute to look up the label for
Returns:
the label

isValidBalanceType

public boolean isValidBalanceType(BalanceType balanceType,
                                  Class entryClass,
                                  String attributeName,
                                  String errorPropertyName)
Description copied from interface: AccountingDocumentRuleHelperService
This method checks for the existence of the provided balance type, in the system and also checks to see if it is active.

Specified by:
isValidBalanceType in interface AccountingDocumentRuleHelperService
entryClass - the Class of the DataDictionary entry containing the attribute with the label for the error message
attributeName - the name of the attribute in the DataDictionary entry
Returns:
True if the balance type is valid, false otherwise.
See Also:
org.kuali.kfs.sys.document.service.AccountingDocumentRuleHelperService#isValidBalanceType(org.kuali.kfs.coa.businessobject.BalanceTyp, java.lang.Class, java.lang.String, java.lang.String)

isValidOpenAccountingPeriod

public boolean isValidOpenAccountingPeriod(AccountingPeriod accountingPeriod,
                                           Class entryClass,
                                           String attribueName,
                                           String errorPropertyName)
Description copied from interface: AccountingDocumentRuleHelperService
This method checks for the existence of the accounting period in the system and also makes sure that the accounting period is open for posting.

Specified by:
isValidOpenAccountingPeriod in interface AccountingDocumentRuleHelperService
Returns:
True if the accounting period exists in the system and is open for posting, false otherwise.
See Also:
AccountingDocumentRuleHelperService.isValidOpenAccountingPeriod(org.kuali.kfs.coa.businessobject.AccountingPeriod, java.lang.Class, java.lang.String, java.lang.String)

isValidReversalDate

public boolean isValidReversalDate(Date reversalDate,
                                   String errorPropertyName)
Description copied from interface: AccountingDocumentRuleHelperService
Some documents have reversal dates. This method represents the common implementation that transactional documents follow for reversal dates - that they must not be before the current date.

Specified by:
isValidReversalDate in interface AccountingDocumentRuleHelperService
Returns:
boolean True if the reversal date is not earlier than the current date, false otherwise.
See Also:
AccountingDocumentRuleHelperService.isValidReversalDate(java.sql.Date, java.lang.String)

formatProperty

public String formatProperty(String propertyName,
                             Object... arguments)
Gets the named property from KualiConfigurationService (i.e., from ApplicationResources.properties) and formats it with the given arguments (if any).

Specified by:
formatProperty in interface AccountingDocumentRuleHelperService
Parameters:
propertyName -
arguments -
Returns:
the formatted property (i.e., message), with any {0} replaced with the first argument, {1} with the second argument, etc.

setDataDictionaryService

public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService ddService)
Sets the dataDictionaryService attribute value.

Parameters:
ddService - The ddService to set.

setObjectTypeService

public void setObjectTypeService(ObjectTypeService objectTypeService)
Sets the objectTypeService attribute value.

Parameters:
objectTypeService - The objectTypeService to set.


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