de.esprit.appsuite.database.xml

## Class DBOXmlWriter<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.io.DataWriter<C>
        - - de.esprit.appsuite.xml.TagWriter<C>
          - - de.esprit.appsuite.xml.XmlTagWriter<C>
            - - de.esprit.appsuite.database.xml.DBOXmlWriter<C>

- All Implemented Interfaces:
    DBOTags, ApplicationObject<C>, AsyncExecutable<C>, CancellableTask, TaskMonitorSupport, SimpleLogSupport, Dumpable, Executable, java.io.Closeable, java.lang.AutoCloseable

      public abstract class DBOXmlWriter<C extends ApplicationContext>
      extends XmlTagWriter<C>
      implements DBOTags

  This writer uses a TagWriter for converting the state of a DBObject to an XML description in order to interface DBObject data with foreign systems.
  Author:
    Rainer Buesch

- - ### Field Summary

    - ### Fields inherited from class de.esprit.appsuite.xml.XmlTagWriter

      `DEFAULT_XML_ENCODING`

    - ### Fields inherited from class de.esprit.appsuite.xml.TagWriter

      `attrs, DEFAULT_ENCODING`

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

      `childTaskRef, isTestMode, monitorController, resultRef, stateFlag`

    - ### Fields inherited from interface de.esprit.appsuite.database.xml.DBOTags

      `ATTR_DATABASE_NAME, ATTR_DBOBJECT_NAME, ATTR_DBOBJECT_VERSION, ATTR_FIELD_FKREF, ATTR_FIELD_NAME, ATTR_FIELD_PK, ATTR_FIELD_TYPE, ATTR_TABLE_NAME, ATTR_TABLE_PACKAGE, TAG_DATABASE, TAG_DBOBJECT, TAG_FIELD, TAG_TABLE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DBOXmlWriter(C ctx, java.io.File file)`
    `DBOXmlWriter(C ctx, java.io.File file, java.lang.String encoding)`
    `DBOXmlWriter(C ctx, java.io.OutputStream out)`
    `DBOXmlWriter(C ctx, java.io.OutputStream out, java.lang.String encoding)`
    `DBOXmlWriter(C ctx, java.lang.String fileName)`
    `DBOXmlWriter(C ctx, java.lang.String fileName, java.lang.String encoding)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `closeDatabase()`
    `void` | `closeTable()`
    `protected void` | `doOnRecordsWritten(DBObject master, int count)`
    `void` | `openDatabase()`
    `void` | `openDatabase(java.lang.String dbName)`
    `void` | `openTable(DBObject master)`
    `void` | `writeDBObject(DBObject dbo)` Prints the given DBObject's data in XML format
    `void` | `writeTable(DBObject master)` Writes the content of the table of the given DBObject master
    `void` | `writeTable(DBObject master, SqlCondition cond)` Writes the selected records of the table of the given DBObject master
    `void` | `writeTable(DBObject master, SqlCondition cond, SqlOrder order)` Writes the selected records of the table of the given DBObject master in the given order

    - ### Methods inherited from class de.esprit.appsuite.xml.XmlTagWriter

      `closeNameSpace, getSimpleTagCloseBracket, getTag, openNameSpace, performWriteHeader`

    - ### Methods inherited from class de.esprit.appsuite.xml.TagWriter

      `attr, close, closeTag, isWritingEmptyTags, openTag, openTag, performWrite, performWriteBody, performWriteFooter, printIndent, setIndentString, setWriteEmptyTags, writeComment, writeTag, writeTag, writeTag, writeTag, writeValue, writeXmlHeader`

    - ### Methods inherited from class de.esprit.appsuite.io.DataWriter

      `createFileOutputStream, executeAsync, flush, format, format, getEncoding, getOutputFile, getWriteDuration, getWriter, openStream, print, print, print, print, print, print, print, print, print, printf, printf, printLine, println, println, println, println, println, println, println, println, println, println, setCloseStreamWhenFinished, setEncoding, setOutputFile, setOutputStream, write, write, write, write, write`

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

      `addMonitor, checkCancelled, checkForErrorAndRethrow, clearMonitors, createRunStateFlag, doOnCancel, 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

    - #### DBOXmlWriter

          public DBOXmlWriter(C ctx,
                      java.lang.String fileName,
                      java.lang.String encoding)

    - #### DBOXmlWriter

          public DBOXmlWriter(C ctx,
                      java.lang.String fileName)

    - #### DBOXmlWriter

          public DBOXmlWriter(C ctx,
                      java.io.File file,
                      java.lang.String encoding)

    - #### DBOXmlWriter

          public DBOXmlWriter(C ctx,
                      java.io.File file)

    - #### DBOXmlWriter

          public DBOXmlWriter(C ctx,
                      java.io.OutputStream out,
                      java.lang.String encoding)

    - #### DBOXmlWriter

          public DBOXmlWriter(C ctx,
                      java.io.OutputStream out)

  - ### Method Detail

    - #### openDatabase

          public void openDatabase()

    - #### openDatabase

          public void openDatabase(java.lang.String dbName)

    - #### closeDatabase

          public void closeDatabase()

    - #### openTable

          public void openTable(DBObject master)

    - #### closeTable

          public void closeTable()

    - #### writeTable

          public void writeTable(DBObject master)
                          throws java.sql.SQLException

      Writes the content of the table of the given DBObject master
      Throws:
        `java.sql.SQLException`

    - #### writeTable

          public void writeTable(DBObject master,
                        SqlCondition cond)
                          throws java.sql.SQLException

      Writes the selected records of the table of the given DBObject master
      Throws:
        `java.sql.SQLException`

    - #### writeTable

          public void writeTable(DBObject master,
                        SqlCondition cond,
                        SqlOrder order)
                          throws java.sql.SQLException

      Writes the selected records of the table of the given DBObject master in the given order
      Throws:
        `java.sql.SQLException`

    - #### doOnRecordsWritten

          protected void doOnRecordsWritten(DBObject master,
                                int count)

    - #### writeDBObject

          public void writeDBObject(DBObject dbo)

      Prints the given DBObject's data in XML format

Copyright © 2014 EsprIT-Systems. All Rights Reserved.