de.esprit.appsuite.xml

## Class XmlTagHandler<C extends XmlDataCollector<?>>

- java.lang.Object
- - org.xml.sax.helpers.DefaultHandler
  - - de.esprit.appsuite.xml.XmlTagHandler<C>

- All Implemented Interfaces:
    SimpleLogSupport, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
  Direct Known Subclasses:
    DBODatabaseTagHandler, DBOFieldTagHandler, DBORecordTagHandler, DBORootDatabaseTagHandler, DBORootTableTagHandler, DBOTableTagHandler

      public abstract class XmlTagHandler<C extends XmlDataCollector<?>>
      extends org.xml.sax.helpers.DefaultHandler
      implements SimpleLogSupport

  This is the base class for XML parsing handlers.
  Author:
    Rainer Buesch

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlTagHandler(C collector)` Constructor for the main-handler
    `XmlTagHandler(XmlTagHandler<C> parent, java.lang.String myTag)` Constructor for secondary handlers that build on top of the main-handler

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `characters(char[] ch, int start, int length)`
    `protected abstract XmlTagHandler<C>` | `createNextHandlerFor(java.lang.String uri, java.lang.String localName, java.lang.String tag)`
    `protected void` | `doOnTagDone(int lineNumber, java.lang.String tagPath)`
    `protected void` | `doOnTagFound(int lineNumber, java.lang.String tagPath)` Is called when a new tag was found.
    `void` | `endDocument()`
    `void` | `endElement(java.lang.String uri, java.lang.String localName, java.lang.String tag)`
    `void` | `error(org.xml.sax.SAXParseException e)`
    `void` | `fatalError(org.xml.sax.SAXParseException e)`
    `protected boolean` | `getAsBoolean(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected boolean` | `getAsBoolean(org.xml.sax.Attributes attrs, java.lang.String param, boolean defaultValue)`
    `protected java.util.Date` | `getAsDate(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected java.util.Date` | `getAsDate(org.xml.sax.Attributes attrs, java.lang.String param, java.util.Date defaultValue)`
    `protected double` | `getAsDouble(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected double` | `getAsDouble(org.xml.sax.Attributes attrs, java.lang.String param, double defaultValue)`
    `protected float` | `getAsFloat(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected float` | `getAsFloat(org.xml.sax.Attributes attrs, java.lang.String param, float defaultValue)`
    `protected int` | `getAsInt(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected int` | `getAsInt(org.xml.sax.Attributes attrs, java.lang.String param, int defaultValue)`
    `protected long` | `getAsLong(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected long` | `getAsLong(org.xml.sax.Attributes attrs, java.lang.String param, long defaultValue)`
    `protected short` | `getAsShort(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected short` | `getAsShort(org.xml.sax.Attributes attrs, java.lang.String param, short defaultValue)`
    `protected java.lang.String` | `getAsString(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected java.lang.String` | `getAsString(org.xml.sax.Attributes attrs, java.lang.String param, java.lang.String defaultValue)`
    `protected java.sql.Timestamp` | `getAsTimestamp(org.xml.sax.Attributes attrs, java.lang.String param)`
    `protected java.sql.Timestamp` | `getAsTimestamp(org.xml.sax.Attributes attrs, java.lang.String param, java.sql.Timestamp defaultValue)`
    `C` | `getCollector()`
    `protected java.lang.String` | `getFinishTag()`
    `FileInfo` | `getInputFileInfo()` Note that only the main-handler stores the inputFile
    `LogChannel` | `getLogChannel()`
    `XmlTagHandler<C>` | `getParentHandler()`
    `XmlDataParser<?>` | `getParser()`
    `java.lang.String` | `getTagPath()`
    `boolean` | `isLogDebug()`
    `boolean` | `isLogVerbose()`
    `void` | `logDebug(java.lang.String message)`
    `void` | `logDump(java.lang.String message)`
    `void` | `logError(java.lang.String message)`
    `void` | `logError(java.lang.String message, java.lang.Exception e)`
    `void` | `logFatal(java.lang.String message, java.lang.Exception e)`
    `void` | `logInfo(java.lang.String message)`
    `void` | `logVerbose(java.lang.String message)`
    `void` | `logWarning(java.lang.String message)`
    `protected void` | `processTagBody(java.lang.String bodyText)`
    `protected void` | `processTagHead(java.lang.String tag, org.xml.sax.Attributes attrs)`
    `org.xml.sax.InputSource` | `resolveEntity(java.lang.String publicId, java.lang.String systemId)`
    `void` | `setDocumentLocator(org.xml.sax.Locator locator)`
    `void` | `setLogChannel(LogChannel logCh)`
    `void` | `startDocument()`
    `void` | `startElement(java.lang.String uri, java.lang.String localName, java.lang.String tag, org.xml.sax.Attributes attrs)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.xml.sax.helpers.DefaultHandler

      `endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning`

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

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

- - ### Constructor Detail

    - #### XmlTagHandler

          public XmlTagHandler(C collector)

      Constructor for the main-handler

    - #### XmlTagHandler

          public XmlTagHandler(XmlTagHandler<C> parent,
                       java.lang.String myTag)

      Constructor for secondary handlers that build on top of the main-handler

  - ### Method Detail

    - #### getTagPath

          public java.lang.String getTagPath()

    - #### characters

          public void characters(char[] ch,
                        int start,
                        int length)
                          throws org.xml.sax.SAXException

      Specified by:
        `characters` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `characters` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### resolveEntity

          public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                              java.lang.String systemId)
                                                throws java.io.IOException,
                                                       org.xml.sax.SAXException

      Specified by:
        `resolveEntity` in interface `org.xml.sax.EntityResolver`
      Overrides:
        `resolveEntity` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `java.io.IOException`
        `org.xml.sax.SAXException`

    - #### startDocument

          public void startDocument()
                             throws org.xml.sax.SAXException

      Specified by:
        `startDocument` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startDocument` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### endDocument

          public void endDocument()
                           throws org.xml.sax.SAXException

      Specified by:
        `endDocument` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endDocument` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### getInputFileInfo

          public FileInfo getInputFileInfo()

      Note that only the main-handler stores the inputFile

    - #### getFinishTag

          protected java.lang.String getFinishTag()

    - #### startElement

          public final void startElement(java.lang.String uri,
                          java.lang.String localName,
                          java.lang.String tag,
                          org.xml.sax.Attributes attrs)
                                  throws org.xml.sax.SAXException

      Specified by:
        `startElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `startElement` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### createNextHandlerFor

          protected abstract XmlTagHandler<C> createNextHandlerFor(java.lang.String uri,
                                              java.lang.String localName,
                                              java.lang.String tag)

    - #### processTagHead

          protected void processTagHead(java.lang.String tag,
                            org.xml.sax.Attributes attrs)
                                 throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### endElement

          public final void endElement(java.lang.String uri,
                        java.lang.String localName,
                        java.lang.String tag)
                                throws org.xml.sax.SAXException

      Specified by:
        `endElement` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `endElement` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### processTagBody

          protected void processTagBody(java.lang.String bodyText)
                                 throws org.xml.sax.SAXException

      Throws:
        `org.xml.sax.SAXException`

    - #### doOnTagFound

          protected void doOnTagFound(int lineNumber,
                          java.lang.String tagPath)

      Is called when a new tag was found.

    - #### doOnTagDone

          protected void doOnTagDone(int lineNumber,
                         java.lang.String tagPath)
                              throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### getParser

          public XmlDataParser<?> getParser()

    - #### getCollector

          public C getCollector()

    - #### getParentHandler

          public XmlTagHandler<C> getParentHandler()

    - #### getAsString

          protected java.lang.String getAsString(org.xml.sax.Attributes attrs,
                                     java.lang.String param)

    - #### getAsString

          protected java.lang.String getAsString(org.xml.sax.Attributes attrs,
                                     java.lang.String param,
                                     java.lang.String defaultValue)

    - #### getAsBoolean

          protected boolean getAsBoolean(org.xml.sax.Attributes attrs,
                             java.lang.String param)

    - #### getAsBoolean

          protected boolean getAsBoolean(org.xml.sax.Attributes attrs,
                             java.lang.String param,
                             boolean defaultValue)

    - #### getAsShort

          protected short getAsShort(org.xml.sax.Attributes attrs,
                         java.lang.String param)

    - #### getAsShort

          protected short getAsShort(org.xml.sax.Attributes attrs,
                         java.lang.String param,
                         short defaultValue)

    - #### getAsInt

          protected int getAsInt(org.xml.sax.Attributes attrs,
                     java.lang.String param)

    - #### getAsInt

          protected int getAsInt(org.xml.sax.Attributes attrs,
                     java.lang.String param,
                     int defaultValue)

    - #### getAsLong

          protected long getAsLong(org.xml.sax.Attributes attrs,
                       java.lang.String param)

    - #### getAsLong

          protected long getAsLong(org.xml.sax.Attributes attrs,
                       java.lang.String param,
                       long defaultValue)

    - #### getAsFloat

          protected float getAsFloat(org.xml.sax.Attributes attrs,
                         java.lang.String param)

    - #### getAsFloat

          protected float getAsFloat(org.xml.sax.Attributes attrs,
                         java.lang.String param,
                         float defaultValue)

    - #### getAsDouble

          protected double getAsDouble(org.xml.sax.Attributes attrs,
                           java.lang.String param)

    - #### getAsDouble

          protected double getAsDouble(org.xml.sax.Attributes attrs,
                           java.lang.String param,
                           double defaultValue)

    - #### getAsDate

          protected java.util.Date getAsDate(org.xml.sax.Attributes attrs,
                                 java.lang.String param)

    - #### getAsDate

          protected java.util.Date getAsDate(org.xml.sax.Attributes attrs,
                                 java.lang.String param,
                                 java.util.Date defaultValue)

    - #### getAsTimestamp

          protected java.sql.Timestamp getAsTimestamp(org.xml.sax.Attributes attrs,
                                          java.lang.String param)

    - #### getAsTimestamp

          protected java.sql.Timestamp getAsTimestamp(org.xml.sax.Attributes attrs,
                                          java.lang.String param,
                                          java.sql.Timestamp defaultValue)

    - #### error

          public void error(org.xml.sax.SAXParseException e)
                     throws org.xml.sax.SAXException

      Specified by:
        `error` in interface `org.xml.sax.ErrorHandler`
      Overrides:
        `error` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### fatalError

          public void fatalError(org.xml.sax.SAXParseException e)
                          throws org.xml.sax.SAXException

      Specified by:
        `fatalError` in interface `org.xml.sax.ErrorHandler`
      Overrides:
        `fatalError` in class `org.xml.sax.helpers.DefaultHandler`
      Throws:
        `org.xml.sax.SAXException`

    - #### setDocumentLocator

          public void setDocumentLocator(org.xml.sax.Locator locator)

      Specified by:
        `setDocumentLocator` in interface `org.xml.sax.ContentHandler`
      Overrides:
        `setDocumentLocator` in class `org.xml.sax.helpers.DefaultHandler`

    - #### getLogChannel

          public LogChannel getLogChannel()

      Specified by:
        `getLogChannel` in interface `SimpleLogSupport`

    - #### setLogChannel

          public void setLogChannel(LogChannel logCh)

      Specified by:
        `setLogChannel` in interface `SimpleLogSupport`

    - #### isLogDebug

          public boolean isLogDebug()

      Specified by:
        `isLogDebug` in interface `SimpleLogSupport`

    - #### isLogVerbose

          public boolean isLogVerbose()

      Specified by:
        `isLogVerbose` in interface `SimpleLogSupport`

    - #### logDebug

          public void logDebug(java.lang.String message)

      Specified by:
        `logDebug` in interface `SimpleLogSupport`

    - #### logDump

          public void logDump(java.lang.String message)

      Specified by:
        `logDump` in interface `SimpleLogSupport`

    - #### logError

          public void logError(java.lang.String message,
                      java.lang.Exception e)

      Specified by:
        `logError` in interface `SimpleLogSupport`

    - #### logError

          public void logError(java.lang.String message)

      Specified by:
        `logError` in interface `SimpleLogSupport`

    - #### logFatal

          public void logFatal(java.lang.String message,
                      java.lang.Exception e)

      Specified by:
        `logFatal` in interface `SimpleLogSupport`

    - #### logInfo

          public void logInfo(java.lang.String message)

      Specified by:
        `logInfo` in interface `SimpleLogSupport`

    - #### logVerbose

          public void logVerbose(java.lang.String message)

      Specified by:
        `logVerbose` in interface `SimpleLogSupport`

    - #### logWarning

          public void logWarning(java.lang.String message)

      Specified by:
        `logWarning` in interface `SimpleLogSupport`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 2014 EsprIT-Systems. All Rights Reserved.