01: /*
02: *
03: * JMoney - A Personal Finance Manager
04: * Copyright (c) 2004 Nigel Westbury <westbury@users.sourceforge.net>
05: *
06: *
07: * This program is free software; you can redistribute it and/or modify
08: * it under the terms of the GNU General Public License as published by
09: * the Free Software Foundation; either version 2 of the License, or
10: * (at your option) any later version.
11: *
12: * This program is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: * GNU General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with this program; if not, write to the Free Software
19: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20: *
21: */
22: package net.sf.jmoney.model2;
23:
24: /**
25: * Some properties are only applicable if another property is set. The other
26: * property may be a boolean property that must be set to true or an enumerated
27: * type that must be set to a certain value. For example, the 'check number'
28: * property of an <code>Entry</code> object would only be applicable if the
29: * account of the <code>Entry</code> object is a <code>BankAccount</code>
30: * object.
31: * <P>
32: * When the applicability of a property depends on the value of other
33: * properties, the property must provide an implementation of this
34: * IPropertyDependency interface.
35: *
36: * @author Nigel Westbury
37: *
38: * @param <E> the class of the object that contains this property, which
39: * must be either ExtendableObject or ExtensionObject
40: */
41: public interface IPropertyDependency<E extends Object> {
42: /**
43: * @param object
44: * the object containing the property
45: * @return true if, given the current state of the given object, the
46: * property is applicable, false if the property is not applicable
47: */
48: boolean isApplicable(E extendableObject);
49: }
|