net.sourceforge.jdbcexporter.config
Class ExportConfig

java.lang.Object
  extended bynet.sourceforge.jdbcexporter.config.ExportConfig

public class ExportConfig
extends java.lang.Object

The ExportConfig class parses a Node to create an ExportDef. The Node's name must be 'export'.

Version:
0.6
Author:
Chris Nagy

Field Summary
static java.lang.String CONNECTION_TAG
          The element name that contains the ConnectionDef.
static java.lang.String CONNECTION_TYPE_ATTR
          The attribute name in the CONNECTION_TAG element that contains the connection type.
protected  CustomObjectFactory connectionDefFactory
          The connection definition object factory.
static java.lang.String ENTITY_TAG
          The element name that contains the EntityDef.
protected  EntityConfig entityConfig
          The entity config that parses entity definitons.
protected  ExportEntityConfigDelegate entityConfigDelegate
          The delegate that helps the entity config parse entity definitions.
static java.lang.String EXPORT_TAG
          The element name that contains the ExportDef.
static java.lang.String LOG_FILE_ATTR
          The attribute name in the LOG_TAG element that contains the filename of the log file.
 
Constructor Summary
ExportConfig()
          Constructs an ExportConfig.
 
Method Summary
 ExportDef getExport(org.w3c.dom.Node node)
          Returns the ExportDef defined in the given Node.
protected  void initConnection(ExportDef exportDef, org.w3c.dom.Node connection)
          Load the connection definition defined in the given node into the ExportDef.
 void setColumnTranslatorFactory(CustomObjectFactory newFactory)
          Sets the factory to use when creating column translators.
 void setConnectionDefFactory(CustomObjectFactory newFactory)
          Sets the factory to use when creating an connection definitions.
 void setDelimiterFormatterFactory(CustomObjectFactory newFactory)
          Sets the factory to use when creating delimiter formatters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXPORT_TAG

public static final java.lang.String EXPORT_TAG
The element name that contains the ExportDef.

See Also:
Constant Field Values

CONNECTION_TAG

public static final java.lang.String CONNECTION_TAG
The element name that contains the ConnectionDef.

See Also:
Constant Field Values

CONNECTION_TYPE_ATTR

public static final java.lang.String CONNECTION_TYPE_ATTR
The attribute name in the CONNECTION_TAG element that contains the connection type.

See Also:
Constant Field Values

LOG_FILE_ATTR

public static final java.lang.String LOG_FILE_ATTR
The attribute name in the LOG_TAG element that contains the filename of the log file.

See Also:
Constant Field Values

ENTITY_TAG

public static final java.lang.String ENTITY_TAG
The element name that contains the EntityDef.

See Also:
Constant Field Values

connectionDefFactory

protected CustomObjectFactory connectionDefFactory
The connection definition object factory.


entityConfig

protected EntityConfig entityConfig
The entity config that parses entity definitons.


entityConfigDelegate

protected ExportEntityConfigDelegate entityConfigDelegate
The delegate that helps the entity config parse entity definitions.

Constructor Detail

ExportConfig

public ExportConfig()
Constructs an ExportConfig.

Method Detail

setConnectionDefFactory

public void setConnectionDefFactory(CustomObjectFactory newFactory)
Sets the factory to use when creating an connection definitions.

Parameters:
newFactory - the connection definition factory

setDelimiterFormatterFactory

public void setDelimiterFormatterFactory(CustomObjectFactory newFactory)
Sets the factory to use when creating delimiter formatters.

Parameters:
newFactory - the delimiter formatter factory

setColumnTranslatorFactory

public void setColumnTranslatorFactory(CustomObjectFactory newFactory)
Sets the factory to use when creating column translators.

Parameters:
newFactory - the column translator factory

getExport

public ExportDef getExport(org.w3c.dom.Node node)
                    throws org.w3c.dom.DOMException,
                           InvalidCustomObjectDefException
Returns the ExportDef defined in the given Node.

Parameters:
node - the node
Returns:
the export definition
Throws:
org.w3c.dom.DOMException - if the Node has missing or invalid attributes/elements
InvalidCustomObjectDefException

initConnection

protected void initConnection(ExportDef exportDef,
                              org.w3c.dom.Node connection)
                       throws org.w3c.dom.DOMException,
                              InvalidCustomObjectDefException
Load the connection definition defined in the given node into the ExportDef.

Parameters:
exportDef - the ExportDef
connection - the node
Throws:
org.w3c.dom.DOMException - if the node is invalid
InvalidCustomObjectDefException - if the connection definition could not be created by the connection definition factory