|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjgnash.imports.qif.QifImport
public class QifImport
QifImport takes a couple of simple steps to prevent importing a duplicate account. Other than that, duplicate transactions will be imported. At this time, it would require a lot of extra and normally unused data to be stored with each transaction and account to prevent duplication. This import utility is ideal for importing an existing data set, but not for importing monthly bank statements. A more specialized import utility may be useful/required for more advanced imports
| Field Summary | |
|---|---|
private java.util.HashMap<java.lang.String,Account> |
accountMap
|
private java.util.ArrayList<Transaction> |
duplicates
A holder for duplicate transactions |
private int |
duplicatesFound
Holds the number of duplicate transactions that were stripped during the import |
private Engine |
engine
|
private java.util.HashMap<java.lang.String,Account> |
expenseMap
|
private java.util.HashMap<java.lang.String,Account> |
incomeMap
|
private java.util.logging.Logger |
logger
|
private QifParser |
parser
|
private boolean |
stripDuplicates
|
private Account |
unassignedExpense
|
private Account |
unassignedIncome
|
| Constructor Summary | |
|---|---|
QifImport()
|
|
| Method Summary | |
|---|---|
private void |
addAccounts()
All of the accounts must be added before the transactions are added because the category (account) must exist first |
private void |
addCategories()
|
private void |
addTransactions(QifAccount qAcc,
Account acc)
|
void |
doFullImport()
|
void |
doFullParse(java.io.File file,
java.lang.String dateFormat)
|
void |
doPartialImport(Account account)
|
void |
doPartialParse(java.io.File file)
|
void |
dumpStats()
|
private Account |
findBestAccount(java.lang.String category)
Returns the best matching account |
private Account |
findBestParent(QifCategory cat,
java.util.Map<java.lang.String,Account> map)
Returns the Account of the best possible parent account for the supplied QifCategory |
private Account |
generateAccount(QifAccount acc)
|
private Account |
generateAccount(QifCategory cat)
|
private TransactionEntry |
generateSplitTransaction(QifSplitTransaction qTran,
Account acc)
Generates a Transaction given a QifSplitTransaction |
private Transaction |
generateTransaction(QifTransaction qTran,
Account acc)
Generates a transaction Notes: If a QifTransaction does not specify an account, then assume it is a single entry transaction for the supplied Account. |
int |
getDuplicateCount()
Returns the number of duplicate transactions that were stripped during the import |
Transaction[] |
getDuplicates()
Return an array of duplicate transactions that were found |
QifParser |
getParser()
|
private void |
importAccounts()
|
private void |
importCategories()
|
private boolean |
isAccount(java.lang.String category)
Determines if the supplied String represents a QIF account |
private boolean |
isDuplicate(Transaction t,
Account a)
|
private void |
loadAccountMap()
|
private void |
loadAccountMap(Account acc)
|
private void |
loadCategoryMap(Account acc,
java.util.Map<java.lang.String,Account> map)
|
private void |
loadCategoryMap(java.util.List<Account> list,
java.util.Map<java.lang.String,Account> map)
|
private void |
reduceCategories()
|
private void |
removeMirrorSplitTransaction(QifSplitTransaction qTran)
|
private void |
removeMirrorTransaction(QifTransaction qTran,
Account acc)
|
void |
setStripDuplicates(boolean strip)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private QifParser parser
private Engine engine
private java.util.HashMap<java.lang.String,Account> expenseMap
private java.util.HashMap<java.lang.String,Account> incomeMap
private java.util.HashMap<java.lang.String,Account> accountMap
private boolean stripDuplicates
private java.util.ArrayList<Transaction> duplicates
private int duplicatesFound
private java.util.logging.Logger logger
private Account unassignedExpense
private Account unassignedIncome
| Constructor Detail |
|---|
public QifImport()
| Method Detail |
|---|
public QifParser getParser()
public void setStripDuplicates(boolean strip)
public void doFullParse(java.io.File file,
java.lang.String dateFormat)
throws NoAccountException
NoAccountExceptionpublic void doFullImport()
public void doPartialParse(java.io.File file)
public void doPartialImport(Account account)
public void dumpStats()
private void importCategories()
private void importAccounts()
private void loadCategoryMap(java.util.List<Account> list,
java.util.Map<java.lang.String,Account> map)
private void loadCategoryMap(Account acc,
java.util.Map<java.lang.String,Account> map)
private void loadAccountMap()
private void loadAccountMap(Account acc)
private void addAccounts()
private void addTransactions(QifAccount qAcc,
Account acc)
private boolean isDuplicate(Transaction t,
Account a)
public int getDuplicateCount()
public Transaction[] getDuplicates()
private void addCategories()
private Account findBestParent(QifCategory cat,
java.util.Map<java.lang.String,Account> map)
private Account findBestAccount(java.lang.String category)
private boolean isAccount(java.lang.String category)
private void reduceCategories()
private Account generateAccount(QifCategory cat)
private Account generateAccount(QifAccount acc)
private Transaction generateTransaction(QifTransaction qTran,
Account acc)
private TransactionEntry generateSplitTransaction(QifSplitTransaction qTran,
Account acc)
private void removeMirrorTransaction(QifTransaction qTran,
Account acc)
private void removeMirrorSplitTransaction(QifSplitTransaction qTran)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||