01: /*
02: * Copyright 2006-2007 The Kuali Foundation.
03: *
04: * Licensed under the Educational Community License, Version 1.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.opensource.org/licenses/ecl1.php
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.kuali.module.gl.service.impl.orgreversion;
17:
18: import org.kuali.module.chart.bo.ObjectCode;
19: import org.kuali.module.gl.service.OrganizationReversionCategoryLogic;
20:
21: /**
22: * The implementation of OrganizationReversionCategoryLogic for cash balances.
23: * @see org.kuali.module.gl.service.OrganizationReversionCategoryLogic
24: */
25: public class CashOrganizationReversionCategoryLogic implements
26: OrganizationReversionCategoryLogic {
27: private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger
28: .getLogger(CashOrganizationReversionCategoryLogic.class);
29:
30: static final public String NAME = "Cash";
31: static final public String CODE = "CASH";
32:
33: /**
34: * Determines if the given object code is an object code for cash balances
35: *
36: * @param oc the object code to qualify
37: * @return true if it is a cash object code, false if otherwise
38: * @see org.kuali.module.gl.service.OrganizationReversionCategoryLogic#containsObjectCode(org.kuali.module.chart.bo.ObjectCode)
39: */
40: public boolean containsObjectCode(ObjectCode oc) {
41: LOG.debug("containsObjectCode() started");
42:
43: ObjectCode chartCashObject = oc.getChartOfAccounts()
44: .getFinancialCashObject();
45: return (chartCashObject.getChartOfAccountsCode().equals(
46: oc.getChartOfAccountsCode()) && chartCashObject
47: .getFinancialObjectCode().equals(
48: oc.getFinancialObjectCode()));
49: }
50:
51: /**
52: * Returns the code for this category, always "CASH"
53: *
54: * @return the code for this category
55: * @see org.kuali.module.gl.service.OrganizationReversionCategoryLogic#getCode()
56: */
57: public String getCode() {
58: return CODE;
59: }
60:
61: /**
62: * Returns the name of this category, always "Cash"
63: *
64: * @return the name of this category
65: * @see org.kuali.module.gl.service.OrganizationReversionCategoryLogic#getName()
66: */
67: public String getName() {
68: return NAME;
69: }
70:
71: /**
72: * Returns if this category represents an expense or not; it never does
73: *
74: * @return false, as the cash category always represents non-expense
75: * @see org.kuali.module.gl.service.OrganizationReversionCategoryLogic#isExpense()
76: */
77: public boolean isExpense() {
78: return false;
79: }
80: }
|