de.esprit.appsuite.nio.ndf

## Class NdfDefaultHandler

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

- All Implemented Interfaces:
    NdfConstants, NdfParseControl, SimpleLogSupport

      public class NdfDefaultHandler
      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, lineCommentChar, ndfAuthorKey, ndfBreakChars, ndfDocCreatedKey, ndfDocTypeKey, ndfDocVersion, ndfDocVersionKey, nullLiteral, quotingBreakChars, separatorLineChar, structureChar, textBreakChars, textParagraph`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NdfDefaultHandler()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `acceptDocumentVersion(java.lang.String documentVersion)` Overridden to log a warning if the ndfDocVersion does not match the NdfParser version.
    `void` | `doneArray(NdfStructure struct)` Called when an array structure is done.
    `void` | `doneDocument()` Called when document parsing has finished.
    `void` | `doneObject(NdfStructure struct)` Called when an object structure is done.
    `void` | `doneProperty(java.lang.String key, java.util.List<java.lang.String> valueList)` Called when a property with multiple values was found within an object structure.
    `void` | `doneProperty(java.lang.String key, java.lang.String value)` Called when a property was found within an object structure.
    `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` | `foundBodyText(NdfStructure struct, java.util.List<java.lang.String> lines)` Called when a body-text was found within an object structure.
    `void` | `foundHeaderProperties(NdfProperties props)` Called when properties are found as top level elements.
    `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.
    `NotifyArrayValue` | `startArray(NdfStructure struct, NdfProperties props, int[] dimensions)` Called when an array structure was found.
    `void` | `startDocument(FileInfo fileInfo, NdfProperties props)` Called when document parsing is about to start.
    `NotifyBodyText` | `startObject(NdfStructure struct, NdfProperties props)` Called when an object structure was detected.
    `void` | `startProperty(java.lang.String key)` Called when a property key was found.
    `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

      `asStuffedText, checkDocumentType, getCurrentNestingLevel, getCurrentStructure, getFileInfo, getLineNumber, getLogChannel, getMaxNestingLevel, getStructure, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

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

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

- - ### Constructor Detail

    - #### NdfDefaultHandler

          public NdfDefaultHandler()

  - ### Method Detail

    - #### acceptDocumentVersion

          public boolean acceptDocumentVersion(java.lang.String documentVersion)

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

    - #### startDocument

          public void startDocument(FileInfo fileInfo,
                           NdfProperties props)
                             throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when document parsing is about to start.
      Overrides:
        `startDocument` in class `NdfHandler`
        `props` - the header properties found in the document
      Throws:
        `java.lang.Exception`

    - #### doneDocument

          public void doneDocument()
                            throws java.lang.Exception

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

    - #### startProperty

          public void startProperty(java.lang.String key)
                             throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a property key was found.
      Overrides:
        `startProperty` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.doneProperty(String, String)`

    - #### doneProperty

          public void doneProperty(java.lang.String key,
                          java.lang.String value)
                            throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a property was found within an object structure.
      Overrides:
        `doneProperty` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.startProperty(String)`

    - #### doneProperty

          public void doneProperty(java.lang.String key,
                          java.util.List<java.lang.String> valueList)
                            throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when a property with multiple values was found within an object structure.
      Overrides:
        `doneProperty` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundHeaderProperties

          public void foundHeaderProperties(NdfProperties props)
                                     throws java.lang.Exception

      Description copied from class: `NdfHandler`
      Called when properties are found as top level elements.
      Overrides:
        `foundHeaderProperties` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### startObject

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

      Description copied from class: `NdfHandler`
      Called when an object structure was detected. Note that there will be an according call to `NdfHandler.foundBodyText(NdfStructure, List)` if this method returns `NotifyBodyText.NOTIFY`. If `NotifyBodyText.SKIP` is returned then no body text evaluation is done at all.
      Overrides:
        `startObject` in class `NdfHandler`
      Throws:
        `java.lang.Exception`

    - #### foundBodyText

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

      Description copied from class: `NdfHandler`
      Called when a body-text was found within an object structure. Note that the body text is read line by line. Leading and trailing white spaces are removed and multiple white spaces are reduced to a single one. Empty lines are ignored by default, but can be enforced by inserting a '^' symbol (paragraph) at the beginning of a line.
      Note also that line- and block-comments both also work within a text body.
      Note that this method is not called, when `NdfHandler.startObject(NdfStructure, NdfProperties)` returned `NotifyBodyText.SKIP`.
      Overrides:
        `foundBodyText` 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. Note that this method returns NotifyTableValue.AS_PROPERTIES by default. Thus by default `NdfHandler.foundTableRow(NdfStructure, int, NdfProperties)` will be called.
      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` mode. It is quite expensive because it parses values the same way as property values.
      Overrides:
        `foundTableRow` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)`

    - #### 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` mode. It is quite expensive because it parses values the same way as property values. But it provides the convenience to extract values in the desired type.
      Overrides:
        `foundTableRow` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.foundTableCell(NdfStructure, int, int, AsciiWord)`

    - #### 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_ASCII_WORD` mode. It is very fast but does no interpretation on the read words at all. You may use methods like word.asDouble() etc. for numeric conversion. Note that this method is called for each row value in a table row.
      Overrides:
        `foundTableCell` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.foundTableRow(NdfStructure, int, String[])`

    - #### 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.
      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` mode. It is quite expensive because it parses values the same way as property values.
      Overrides:
        `foundArrayValue` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)`

    - #### 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_ASCII_WORD` mode. It is very fast but does no interpretation on the read words at all. You may use methods like word.asDouble() etc. for numeric conversion.
      Overrides:
        `foundArrayValue` in class `NdfHandler`
      Throws:
        `java.lang.Exception`
      See Also:
        `NdfHandler.foundArrayValue(NdfStructure, int, int, AsciiWord)`

    - #### 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`

Copyright © 2013 EsprIT-Systems. All Rights Reserved.