de.esprit.appsuite.nio.ndf

## Class DumpingNdfHandler

- java.lang.Object
- - de.esprit.appsuite.nio.ndf.NdfHandler
  - - de.esprit.appsuite.nio.ndf.DumpingNdfHandler

- All Implemented Interfaces:
    NdfConstants, NdfParseControl, SimpleLogSupport

      public class DumpingNdfHandler
      extends NdfHandler

  This handler just logs all method calls.
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from interface de.esprit.appsuite.nio.ndf.NdfConstants

      `allowedInNames, blockCommentChar, booleanFalseChar, booleanFalseLiteral, booleanTrueChar, booleanTrueLiteral, currentNdfDocVersion, defaultTextEndChar, defaultTextParagraphChar, lineCommentChar, ndfDocAuthorKey, ndfDocCreatedKey, ndfDocEncodingKey, ndfDocTypeKey, ndfDocVersionKey, nullLiteral, quotingBreakCodes, standardBreakCodes, structureChar, textValueBreakCodes, validTextBreakSymbols`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DumpingNdfHandler()`
    `DumpingNdfHandler(java.io.File outputFile)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acceptDocumentVersion(java.lang.String documentVersion)` Overridden to log a warning if the currentNdfDocVersion does not match the NdfParser version.
    `void` | `doneArray(NdfStructure struct)` Called when an array structure is done.
    `void` | `doneDocument(NdfStructure struct)` Called when document parsing has finished.
    `void` | `doneList(NdfStructure struct)` Called when a list structure is done.
    `void` | `doneObject(NdfStructure struct)` Called when an object structure is done.
    `void` | `doneTable(NdfStructure struct)` Called when a table structure is done.
    `void` | `foundArrayValue(NdfStructure struct, int dimension, int index, AsciiWord word)` Called when an array value was found within an array structure.
    `void` | `foundArrayValue(NdfStructure struct, int dimension, int index, java.lang.String value)` Called when an array value was found within an array structure.
    `void` | `foundListValue(NdfStructure struct, AsciiWord data)` Called when a list value was found within a list structure.
    `void` | `foundListValue(NdfStructure struct, java.lang.String value)` Called when a list value was found within a list structure.
    `void` | `foundProperties(NdfStructure struct, NdfProperties props)` Called when properties are found on top level.
    `void` | `foundTableCell(NdfStructure struct, int rowIndex, int columnIndex, AsciiWord data)` Called when a table cell value was found within a table structure.
    `void` | `foundTableRow(NdfStructure struct, int rowIndex, NdfProperties rowProps)` Called when a table row was found within a table structure.
    `void` | `foundTableRow(NdfStructure struct, int rowIndex, java.lang.String[] rowData)` Called when a table row was found within a table structure.
    `void` | `foundText(NdfStructure struct, int paragraphIndex, java.util.List<java.lang.String> lines)` Notifies about text-lines found within a TEXT structure.
    `void` | `foundText(NdfStructure struct, java.lang.String text)` Notifies about the text found within a TEXT structure.
    `NotifyArrayValue` | `startArray(NdfStructure struct, NdfProperties props, int[] dimensions)` Called when an array structure was found.
    `void` | `startDocument(NdfStructure struct, NdfProperties props)` Called when document parsing is started.
    `NotifyListValue` | `startList(NdfStructure struct, NdfProperties props)` Called when a list structure was found.
    `void` | `startObject(NdfStructure struct, NdfProperties props)` Called when an object structure was detected.
    `NotifyTableValue` | `startTable(NdfStructure struct, NdfProperties props, java.lang.String[] columns)` Called when a table structure was found.

    - ### Methods inherited from class de.esprit.appsuite.nio.ndf.NdfHandler

      `checkDocumentType, doneText, getCurrentNestingLevel, getCurrentStructure, getDocAuthor, getDocCreated, getDocEncoding, getDocType, getDocVersion, getFileInfo, getLineNumber, getLogChannel, getMaxNestingLevel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel, startText`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DumpingNdfHandler

          public DumpingNdfHandler()

    - #### DumpingNdfHandler

          public DumpingNdfHandler(java.io.File outputFile)
                            throws java.lang.Exception

      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### acceptDocumentVersion

          public boolean acceptDocumentVersion(java.lang.String documentVersion)

      Overridden to log a warning if the currentNdfDocVersion does not match the NdfParser version.
      Overrides:
        `acceptDocumentVersion` in class `NdfHandler`

    - #### startDocument

          public void startDocument(NdfStructure struct,
                           NdfProperties props)
                             throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when document parsing is started. Note that the document header properties are already read before this call.
      Overrides:
        `startDocument` in class `NdfHandler`
        `props` - the header properties found in the document
      Throws:
        `java.lang.Exception`

    - #### doneDocument

          public void doneDocument(NdfStructure struct)
                            throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when document parsing has finished.
      Overrides:
        `doneDocument` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundProperties

          public void foundProperties(NdfStructure struct,
                             NdfProperties props)
                               throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when properties are found on top level. Note that all properties on deeper levels obtain to the according structures and thus are passed to them.
      Overrides:
        `foundProperties` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### startObject

          public void startObject(NdfStructure struct,
                         NdfProperties props)
                           throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when an object structure was detected.
      Overrides:
        `startObject` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundText

          public void foundText(NdfStructure struct,
                       int paragraphIndex,
                       java.util.List<java.lang.String> lines)
                         throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Notifies about text-lines found within a TEXT structure. Note that the line-feed symbols are represented by empty lines in the passed list.
      Overrides:
        `foundText` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundText

          public void foundText(NdfStructure struct,
                       java.lang.String text)
                         throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Notifies about the text found within a TEXT structure. Note that the text is stuffed which means: leading and trailing white spaces are removed and multiple white spaces are reduced to a single one. Note also that the LF symbols (line-feeds) are represented by '\n' characters in the passed String.
      Overrides:
        `foundText` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### doneObject

          public void doneObject(NdfStructure struct)
                          throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when an object structure is done.
      Overrides:
        `doneObject` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### startTable

          public NotifyTableValue startTable(NdfStructure struct,
                                    NdfProperties props,
                                    java.lang.String[] columns)
                                      throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a table structure was found. The return value of this method defines which type of notification takes place and thus defines which method needs to be overridden in order to receive the table value notification.
      - `NotifyTableValue.AS_PROPERTIES`
        causes notification by properties calling `NdfHandler.foundTableRow(NdfStructure, int, NdfProperties)`
        this is the default way of notification.
      - `NotifyTableValue.AS_STRING_ARRAY`
        causes notification by String[] calling `NdfHandler.foundTableRow(NdfStructure, int, String[])`
      - `NotifyTableValue.AS_BUFFERED_WORD`
        causes notification by AsciiWord calling `NdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)`
        This is the fastest way of notification, but it works only for pure number values.
      Overrides:
        `startTable` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundTableRow

          public void foundTableRow(NdfStructure struct,
                           int rowIndex,
                           java.lang.String[] rowData)
                             throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a table row was found within a table structure. This method is called in `NotifyTableValue.AS_STRING_ARRAY` notification mode. It is quite expensive because it parses values the same way as property values.
      Overrides:
        `foundTableRow` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundTableRow

          public void foundTableRow(NdfStructure struct,
                           int rowIndex,
                           NdfProperties rowProps)
                             throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a table row was found within a table structure. This method is called in `NotifyTableValue.AS_PROPERTIES` notification mode. It is quite expensive because it parses values the same way as property values. But it provides the convenience to extract values readily converted to the desired data type.
      Overrides:
        `foundTableRow` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundTableCell

          public void foundTableCell(NdfStructure struct,
                            int rowIndex,
                            int columnIndex,
                            AsciiWord data)
                              throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a table cell value was found within a table structure. This method is called in `NotifyTableValue.AS_BUFFERED_WORD` notification mode. It is very fast but does no interpretation on the read words at all. It does also NOT support quoting of values and thus can only be used for numeric values. For fast data conversion use data.asDouble(), data.asInt() etc. Note that this method is called for each cell value in a table row.
      Overrides:
        `foundTableCell` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### doneTable

          public void doneTable(NdfStructure struct)
                         throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a table structure is done.
      Overrides:
        `doneTable` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### startArray

          public NotifyArrayValue startArray(NdfStructure struct,
                                    NdfProperties props,
                                    int[] dimensions)
                                      throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when an array structure was found. The return value of this method defines which type of notification takes place and thus defines which method needs to be overridden in order to receive the array value notification.
      - `NotifyArrayValue.AS_STRING`
        causes notification by String calling `NdfHandler.foundArrayValue(NdfStructure, int, int, String)`
      - `NotifyArrayValue.AS_BUFFERED_WORD`
        causes notification by AsciiWord calling `NdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)`
        This is the fastest way of notification, but it works only for pure number values.
      Overrides:
        `startArray` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundArrayValue

          public void foundArrayValue(NdfStructure struct,
                             int dimension,
                             int index,
                             java.lang.String value)
                               throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when an array value was found within an array structure. This method is called in `NotifyArrayValue.AS_STRING` notification mode. It is quite expensive because it parses values the same way as property values.
      Overrides:
        `foundArrayValue` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundArrayValue

          public void foundArrayValue(NdfStructure struct,
                             int dimension,
                             int index,
                             AsciiWord word)
                               throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when an array value was found within an array structure. This method is called in `NotifyArrayValue.AS_BUFFERED_WORD` notification mode. It is very fast but does no interpretation on the read words at all. For fast data conversion use data.asDouble(), data.asInt() etc.
      Overrides:
        `foundArrayValue` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### doneArray

          public void doneArray(NdfStructure struct)
                         throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when an array structure is done.
      Overrides:
        `doneArray` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### startList

          public NotifyListValue startList(NdfStructure struct,
                                  NdfProperties props)
                                    throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a list structure was found. The return value of this method defines which type of notification takes place and thus defines which method needs to be overridden in order to receive the list value notification.
      - `NotifyListValue.AS_STRING`
        causes notification by String calling `NdfHandler.foundListValue(NdfStructure, String)`
      - `NotifyListValue.AS_BUFFERED_WORD`
        causes notification by AsciiWord calling `NdfHandler.foundListValue(NdfStructure, AsciiWord)`
        This is the fastest way of notification, but it works only for pure number values.
      Overrides:
        `startList` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundListValue

          public void foundListValue(NdfStructure struct,
                            java.lang.String value)
                              throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a list value was found within a list structure. This method is called in `NotifyListValue.AS_STRING` notification mode. It is quite expensive because it parses values the same way as property values.
      Overrides:
        `foundListValue` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundListValue

          public void foundListValue(NdfStructure struct,
                            AsciiWord data)
                              throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a list value was found within a list structure. This method is called in `NotifyListValue.AS_BUFFERED_WORD` notification mode. It is very fast but does no interpretation on the read words at all. For fast data conversion use data.asDouble(), data.asInt() etc.
      Overrides:
        `foundListValue` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### doneList

          public void doneList(NdfStructure struct)
                        throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a list structure is done.
      Overrides:
        `doneList` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.