de.esprit.appsuite.xml

## Class XmlDataParser<C extends ApplicationContext>

- java.lang.Object
- - de.esprit.common.util.DumpableObject
  - - de.esprit.appsuite.launch.AbstractApplicationObject<C>
    - - de.esprit.appsuite.task.AbstractAsyncExecutable<C>
      - - de.esprit.appsuite.xml.XmlDataParser<C>

- All Implemented Interfaces:
    ApplicationObject<C>, AsyncExecutable<C>, CancellableTask, TaskMonitorSupport, SimpleLogSupport, Dumpable, Executable
  Direct Known Subclasses:
    DBOXmlReader

      public class XmlDataParser<C extends ApplicationContext>
      extends AbstractAsyncExecutable<C>

  This is a template how to do XML parsing
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlDataParser(C ctx, java.io.File file, boolean isValidating)`
    `XmlDataParser(C ctx, java.io.File file, XmlTagHandler handler, boolean isValidating)`
    `XmlDataParser(C ctx, java.io.InputStream inStream, XmlTagHandler handler, boolean isValidating)`
    `XmlDataParser(C ctx, LogChannel logCh, java.io.File file, XmlTagHandler handler, boolean isValidating)`
    `XmlDataParser(C ctx, LogChannel logCh, java.io.InputStream inStream, XmlTagHandler handler, boolean isValidating)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doOnCancel()` This method is called after having detected cancellation.
    `void` | `executeAsync()` Contains the code to be executed asynchronously.
    `XmlDataCollector` | `getCollector()`
    `FileInfo` | `getInputFileInfo()`
    `javax.xml.parsers.SAXParser` | `getSAXParser()`
    `protected void` | `logClosed(FileInfo fileInfo)` Is called after the file has been closed
    `protected void` | `logOpen(FileInfo fileInfo)` Is called when the file is being opened
    `void` | `setHandler(XmlTagHandler handler)`

    - ### Methods inherited from class de.esprit.appsuite.task.AbstractAsyncExecutable

      `addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnFailure, execute, executeSubTask, getError, getMaxProgressSteps, getMonitorCount, getMonitors, getName, getProgressStepCount, getResult, getRunStateFlag, getTaskId, getType, handleCancellation, handleFailure, handleFinish, handleStart, handleSuccess, hasError, hasMonitor, isCancellable, notifyProceeded, registerTaskStateChange, removeMonitor, resetProgress, setCancellable, setLogLevel, setMaxProgressSteps, setMonitor, setName, setName, setResult, setRunStateFlag, setTaskId, setType, shouldFireMonitor, sleepChecked, wasCancelled`

    - ### Methods inherited from class de.esprit.appsuite.launch.AbstractApplicationObject

      `getApplicationContext, getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

    - ### Methods inherited from class de.esprit.common.util.DumpableObject

      `configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toDumpString, toString, toString`

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

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

    - ### Methods inherited from interface de.esprit.appsuite.launch.ApplicationObject

      `getApplicationContext`

    - ### Methods inherited from interface de.esprit.common.log.SimpleLogSupport

      `getLogChannel, isLogDebug, isLogVerbose, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setLogChannel`

- - ### Constructor Detail

    - #### XmlDataParser

          public XmlDataParser(C ctx,
                       java.io.File file,
                       boolean isValidating)

    - #### XmlDataParser

          public XmlDataParser(C ctx,
                       java.io.File file,
                       XmlTagHandler handler,
                       boolean isValidating)

    - #### XmlDataParser

          public XmlDataParser(C ctx,
                       LogChannel logCh,
                       java.io.File file,
                       XmlTagHandler handler,
                       boolean isValidating)

    - #### XmlDataParser

          public XmlDataParser(C ctx,
                       java.io.InputStream inStream,
                       XmlTagHandler handler,
                       boolean isValidating)

    - #### XmlDataParser

          public XmlDataParser(C ctx,
                       LogChannel logCh,
                       java.io.InputStream inStream,
                       XmlTagHandler handler,
                       boolean isValidating)

  - ### Method Detail

    - #### setHandler

          public void setHandler(XmlTagHandler handler)

    - #### logOpen

          protected void logOpen(FileInfo fileInfo)

      Is called when the file is being opened

    - #### logClosed

          protected void logClosed(FileInfo fileInfo)

      Is called after the file has been closed

    - #### getInputFileInfo

          public FileInfo getInputFileInfo()

    - #### getSAXParser

          public javax.xml.parsers.SAXParser getSAXParser()

    - #### executeAsync

          public final void executeAsync()
                                  throws java.lang.Exception

      Description copied from interface: `AsyncExecutable`
      Contains the code to be executed asynchronously. WARNING: This method should never be called directly by the programmer. It rather must be called by `Runnable.run()` for async execution.
      Specified by:
        `executeAsync` in interface `AsyncExecutable<C extends ApplicationContext>`
      Specified by:
        `executeAsync` in class `AbstractAsyncExecutable<C extends ApplicationContext>`
      Throws:
        `java.lang.Exception`
      See Also:
        `for synchronous execution`

    - #### getCollector

          public XmlDataCollector getCollector()

    - #### doOnCancel

          protected void doOnCancel()

      Description copied from class: `AbstractAsyncExecutable`
      This method is called after having detected cancellation. May be overridden to perform any cleanup. Note that any Exceptions thrown are caught and just logged but do NOT affect the task.
      Overrides:
        `doOnCancel` in class `AbstractAsyncExecutable<C extends ApplicationContext>`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.