jgnash.engine.xml
Class XMLAccountDAO

java.lang.Object
  extended by jgnash.engine.dao.AbstractDAO
      extended by jgnash.engine.xml.AbstractXMLDAO
          extended by jgnash.engine.xml.XMLAccountDAO
All Implemented Interfaces:
AccountDAO

public class XMLAccountDAO
extends AbstractXMLDAO
implements AccountDAO

XML Account DAO

Version:
$Id$
Author:
Craig Cavanaugh

Field Summary
private static java.util.logging.Logger logger
           
 
Fields inherited from class jgnash.engine.xml.AbstractXMLDAO
commitCount, container, MAX_COMMIT_TIME
 
Constructor Summary
XMLAccountDAO(XMLContainer container)
           
 
Method Summary
 boolean addAccount(Account parent, Account child)
           
 boolean addAccountSecurity(Account account, SecurityNode node)
          Adds a SecurityNode from a InvestmentAccount
 boolean addRootAccount(RootAccount account)
           
private  java.util.List<Account> getAccountByType(AccountType type)
           
 Account getAccountByUuid(java.lang.String uuid)
           
 java.util.List<Account> getAccountList()
           
 java.util.List<Account> getExpenseAccountList()
          Returns a list of ExpenseAccounts
 java.util.List<Account> getIncomeAccountList()
          Returns a list of IncomeAccounts
 java.util.List<Account> getInvestmentAccountList()
          Returns a list of InvestmentAccounts
 RootAccount getRootAccount()
           
 void refreshAccount(Account account)
          Force the engine to refresh the loading account.
 boolean removeAccountProperty(Account account, java.lang.Object object)
           
 boolean setAccountProperty(Account account, java.lang.Object object)
           
 boolean toggleAccountVisibility(Account account)
          Toggles the visibility of an account given its ID.
 boolean updateAccount(Account account)
           
 
Methods inherited from class jgnash.engine.xml.AbstractXMLDAO
commit, commitAndReset
 
Methods inherited from class jgnash.engine.dao.AbstractDAO
stripMarkedForRemoval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static java.util.logging.Logger logger
Constructor Detail

XMLAccountDAO

XMLAccountDAO(XMLContainer container)
Method Detail

getRootAccount

public RootAccount getRootAccount()
Specified by:
getRootAccount in interface AccountDAO

getAccountList

public java.util.List<Account> getAccountList()
Specified by:
getAccountList in interface AccountDAO

addAccount

public boolean addAccount(Account parent,
                          Account child)
Specified by:
addAccount in interface AccountDAO

addRootAccount

public boolean addRootAccount(RootAccount account)
Specified by:
addRootAccount in interface AccountDAO

addAccountSecurity

public boolean addAccountSecurity(Account account,
                                  SecurityNode node)
Description copied from interface: AccountDAO
Adds a SecurityNode from a InvestmentAccount

Specified by:
addAccountSecurity in interface AccountDAO
Parameters:
account - account to add security to
node - security to add
Returns:
true if success

getIncomeAccountList

public java.util.List<Account> getIncomeAccountList()
Description copied from interface: AccountDAO
Returns a list of IncomeAccounts

Specified by:
getIncomeAccountList in interface AccountDAO
Returns:
list of income accounts

getExpenseAccountList

public java.util.List<Account> getExpenseAccountList()
Description copied from interface: AccountDAO
Returns a list of ExpenseAccounts

Specified by:
getExpenseAccountList in interface AccountDAO
Returns:
list of expense accounts

getInvestmentAccountList

public java.util.List<Account> getInvestmentAccountList()
Description copied from interface: AccountDAO
Returns a list of InvestmentAccounts

Specified by:
getInvestmentAccountList in interface AccountDAO
Returns:
list of investment accounts

getAccountByUuid

public Account getAccountByUuid(java.lang.String uuid)
Specified by:
getAccountByUuid in interface AccountDAO

updateAccount

public boolean updateAccount(Account account)
Specified by:
updateAccount in interface AccountDAO

setAccountProperty

public boolean setAccountProperty(Account account,
                                  java.lang.Object object)
Specified by:
setAccountProperty in interface AccountDAO

removeAccountProperty

public boolean removeAccountProperty(Account account,
                                     java.lang.Object object)
Specified by:
removeAccountProperty in interface AccountDAO

toggleAccountVisibility

public boolean toggleAccountVisibility(Account account)
Description copied from interface: AccountDAO
Toggles the visibility of an account given its ID.

Specified by:
toggleAccountVisibility in interface AccountDAO
Parameters:
account - The account to toggle visibility
Returns:
true if the supplied account ID was found false if the supplied account ID was not found

refreshAccount

public void refreshAccount(Account account)
Description copied from interface: AccountDAO
Force the engine to refresh the loading account. Intended for client / server use

Specified by:
refreshAccount in interface AccountDAO
Parameters:
account - account to refresh

getAccountByType

private java.util.List<Account> getAccountByType(AccountType type)