001: /*
002: *
003: * JMoney - A Personal Finance Manager
004: * Copyright (c) 2004 Nigel Westbury <westbury@users.sourceforge.net>
005: *
006: *
007: * This program is free software; you can redistribute it and/or modify
008: * it under the terms of the GNU General Public License as published by
009: * the Free Software Foundation; either version 2 of the License, or
010: * (at your option) any later version.
011: *
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: * GNU General Public License for more details.
016: *
017: * You should have received a copy of the GNU General Public License
018: * along with this program; if not, write to the Free Software
019: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
020: *
021: */
022:
023: package net.sf.jmoney.qif;
024:
025: import net.sf.jmoney.model2.EntryExtension;
026: import net.sf.jmoney.model2.ExtendableObject;
027:
028: /**
029: * Property set implementation class for the properties added
030: * to each Entry object by this plug-in.
031: *
032: * @author Nigel Westbury
033: */
034: public class QIFEntry extends EntryExtension {
035:
036: private char reconcilingState = ' ';
037: private String address = null;
038:
039: /**
040: * A default constructor is mandatory for all extension objects.
041: * The default constructor sets the extension properties to
042: * appropriate default values.
043: */
044: public QIFEntry(ExtendableObject extendedObject) {
045: super (extendedObject);
046: }
047:
048: /**
049: * A Full constructor is mandatory for all extension objects.
050: * This constructor is called by the datastore to construct
051: * the extension objects when loading data.
052: *
053: * @param reconcilingState
054: */
055: public QIFEntry(ExtendableObject extendedObject,
056: char reconcilingState, String address) {
057: super (extendedObject);
058: this .reconcilingState = reconcilingState;
059: this .address = address;
060: }
061:
062: /**
063: * Gets the status of the entry.
064: *
065: * @return The status of the entry.
066: * <LI>
067: * <UL>' ' - the entry not not been reconciled</UL>
068: * <UL>'*' - the entry is being reconciled</UL>
069: * <UL>'X' - the entry has cleared and shows on the statement</UL>
070: * </LI>
071: */
072: public char getReconcilingState() {
073: return reconcilingState;
074: }
075:
076: /**
077: * Gets the address of the payee for the bank account debit represented by
078: * this entry.
079: *
080: * @return The address, with each line separated by a '/n' character. QIF
081: * files usually support up to five lines of address, but there may
082: * be a sixth line for an optional message. Null will be returned if
083: * no address is set.
084: */
085: public String getAddress() {
086: return address;
087: }
088:
089: /**
090: * Sets the status of the entry.
091: *
092: * @param reconcilingState the new status of the entry.
093: * <LI>
094: * <UL>' ' - the entry not not been reconciled</UL>
095: * <UL>'*' - the entry is being reconciled</UL>
096: * <UL>'X' - the entry has cleared and shows on the statement</UL>
097: * </LI>
098: */
099: public void setReconcilingState(char reconcilingState) {
100: char oldReconcilingState = this .reconcilingState;
101: this .reconcilingState = reconcilingState;
102: processPropertyChange(QIFEntryInfo
103: .getReconcilingStateAccessor(), oldReconcilingState,
104: reconcilingState);
105: }
106:
107: /**
108: * Sets the address.
109: *
110: * @param address
111: * The address, with each line separated by a '/n' character. QIF
112: * files usually support up to five lines of address, but there
113: * may be a sixth line for an optional message. Null may be set
114: * to indicate no address.
115: */
116: public void setAddress(String address) {
117: String oldAddress = this.address;
118: this.address = address;
119: processPropertyChange(QIFEntryInfo.getAddressAccessor(),
120: oldAddress, address);
121: }
122: }
|