Class OFXBankStatementHandler

  • All Implemented Interfaces:
    ContentHandler, DTDHandler, EntityResolver, ErrorHandler
    Direct Known Subclasses:
    OFXFileBankStatementLoader

    public abstract class OFXBankStatementHandler
    extends DefaultHandler
    Parser for OFX bank statements This class is a parser for OFX bankstatements. OFX versions from 102 to 202 and MS-Money OFC message sets are supported. Only fully XML compliant OFX data is supported. Files that are not XML compliant, e.g. OFX versions older then 200, will be preprocessed by the OFX1ToXML class before parsing. This class should be extended by a class that obtains the data to be parsed for example from a file, or using HTTP.
    Version:
    $Id: OFXBankStatementHandler.java,v 1.3 2006/07/30 00:51:05 jjanke Exp $
    Author:
    Eldir Tomassen
    • Constructor Detail

      • OFXBankStatementHandler

        public OFXBankStatementHandler()
    • Method Detail

      • init

        protected boolean init​(MBankStatementLoader controller)
        Initialize the loader * @param controller Reference to the BankStatementLoaderController
        Returns:
        Initialized succesfully
      • attachInput

        protected boolean attachInput​(InputStream is)
        Attach OFX input source, detect whether we are dealing with OFX1 (SGML) or OFX2 (XML). In case of OFX1, process the data to create valid XML.
        Parameters:
        is - Reference to the BankStatementLoaderController
        Returns:
        true if input is valid OFX data
      • isValid

        public boolean isValid()
        Verify the validity of the OFX data
        Returns:
        true if input is valid OFX data
      • importSuccessfull

        public boolean importSuccessfull()
        Check wether the import was succesfull
        Returns:
        true if all statement lines have been imported succesfully
      • loadLines

        public boolean loadLines()
        Read statementlines from InputStream.
        Returns:
        load success This method will be invoked from ImportController.
      • getDateLastRun

        public Timestamp getDateLastRun()
        Method getDateLastRun
        Returns:
        Timestamp
      • getRoutingNo

        public String getRoutingNo()
        Method getRoutingNo
        Returns:
        String
      • getBankAccountNo

        public String getBankAccountNo()
        Method getBankAccountNo
        Returns:
        String
      • getIBAN

        public String getIBAN()
        Method getIBAN
        Returns:
        String
      • getStatementReference

        public String getStatementReference()
        Method getStatementReference
        Returns:
        String
      • getStatementDate

        public Timestamp getStatementDate()
        Method getStatementDate
        Returns:
        Timestamp
      • getReference

        public String getReference()
        Method getReference
        Returns:
        String
      • getStatementLineDate

        public Timestamp getStatementLineDate()
        Method getStatementLineDate
        Returns:
        Timestamp
      • getValutaDate

        public Timestamp getValutaDate()
        Method getValutaDate
        Returns:
        Timestamp
      • getTrxType

        public String getTrxType()
        Method getTrxType
        Returns:
        String
      • getIsReversal

        public boolean getIsReversal()
        Method getIsReversal
        Returns:
        boolean
      • getCurrency

        public String getCurrency()
        Method getCurrency
        Returns:
        String
      • getStmtAmt

        public BigDecimal getStmtAmt()
        Method getStmtAmt
        Returns:
        BigDecimal
      • getTrxAmt

        public BigDecimal getTrxAmt()
        Method getTrxAmt
        Returns:
        Transaction Amount
      • getInterestAmt

        public BigDecimal getInterestAmt()
        Method getInterestAmount
        Returns:
        Interest Amount
      • getMemo

        public String getMemo()
        Method getMemo
        Returns:
        String
      • getChargeName

        public String getChargeName()
        Method getChargeName
        Returns:
        String
      • getChargeAmt

        public BigDecimal getChargeAmt()
        Method getChargeAmt
        Returns:
        BigDecimal
      • getTrxID

        public String getTrxID()
        Method getTrxID
        Returns:
        String
      • getPayeeAccountNo

        public String getPayeeAccountNo()
        Method getPayeeAccountNo
        Returns:
        String
      • getPayeeName

        public String getPayeeName()
        Method getPayeeName
        Returns:
        String
      • getCheckNo

        public String getCheckNo()
        Method getCheckNo
        Returns:
        String
      • parseTimeZone

        protected TimeZone parseTimeZone​(String tzoffset)
        Parse the timezone offset of the form [HOURS_OFF_GMT:TZ_ID]
        Parameters:
        tzoffset - The offset pattern.
        Returns:
        The timezone.
      • parseDate

        protected Date parseDate​(String value)
        Parses a date according to OFX.
        Parameters:
        value - The value of the date.
        Returns:
        The date value.
      • getLastErrorMessage

        public String getLastErrorMessage()
        Method getLastErrorMessage
        Returns:
        String
      • getLastErrorDescription

        public String getLastErrorDescription()
        Method getLastErrorDescription
        Returns:
        String