net.sourceforge.datagenerator.config
Class GenerateConfig

java.lang.Object
  extended bynet.sourceforge.datagenerator.config.GenerateConfig

public class GenerateConfig
extends java.lang.Object

The GenerateConfig class parses a Node to create an GenerateDef. The Node's name must be 'generate'.

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 data generate entity definitons.
protected  GenerateEntityConfigDelegate entityConfigDelegate
          The delegate that helps the entity config parse data generate entity definitions.
protected  EntityConfig exportEntityConfig
          The entity config that parses export entity definitons.
protected  ExportEntityConfigDelegate exportEntityConfigDelegate
          The delegate that helps the entity config parse export entity definitions.
static java.lang.String GENERATE_TAG
          The element name that contains the GenerateDef.
protected  EntityConfig importEntityConfig
          The entity config that parses import entity definitons.
protected  ImportEntityConfigDelegate importEntityConfigDelegate
          The delegate that helps the entity config parse import entity definitions.
static java.lang.String LOG_FILE_ATTR
          The attribute name in the LOG_TAG element that contains the filename of the log file.
static java.lang.String SOURCE_DB_VALUE
          The source attribute's value that indicates that the entity should be an ExportEntityDef.
 
Constructor Summary
GenerateConfig()
          Constructs an GenerateConfig.
 
Method Summary
protected  EntityConfig getEntityConfig(org.w3c.dom.Node entity)
          Returns the correct EntityConfig that can handle parsing the given node.
 GenerateDef getGenerate(org.w3c.dom.Node node)
          Returns the GenerateDef defined in the given Node.
protected  void initConnection(GenerateDef generateDef, org.w3c.dom.Node connection)
          Load the connection definition defined in the given node into the GenerateDef.
 void setBinaryDelimiterParserFactory(CustomObjectFactory newFactory)
          Sets the BinaryDelimiterParserFactory to use when creating EntityDef(s).
 void setColumnTranslatorFactory(CustomObjectFactory newFactory)
          Sets the ColumnTranslatorFactory to use when creating EntityDef(s).
 void setColumnValueGeneratorFactory(CustomObjectFactory newFactory)
          Sets the ColumnValueGeneratorFactory to use when creating EntityDef(s).
 void setConnectionDefFactory(CustomObjectFactory newFactory)
          Sets the ConnectionDefFactory to use when creating an GenerateDef.
 void setDelimiterFormatterFactory(CustomObjectFactory newFactory)
          Sets the DelimiterFormatterFactory to use when creating EntityDef(s).
 void setDelimiterParserFactory(CustomObjectFactory newFactory)
          Sets the DelimiterParserFactory to use when creating EntityDef(s).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GENERATE_TAG

public static final java.lang.String GENERATE_TAG
The element name that contains the GenerateDef.

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

SOURCE_DB_VALUE

public static final java.lang.String SOURCE_DB_VALUE
The source attribute's value that indicates that the entity should be an ExportEntityDef.

See Also:
Constant Field Values

connectionDefFactory

protected CustomObjectFactory connectionDefFactory
The connection definition object factory.


entityConfig

protected EntityConfig entityConfig
The entity config that parses data generate entity definitons.


importEntityConfig

protected EntityConfig importEntityConfig
The entity config that parses import entity definitons.


exportEntityConfig

protected EntityConfig exportEntityConfig
The entity config that parses export entity definitons.


entityConfigDelegate

protected GenerateEntityConfigDelegate entityConfigDelegate
The delegate that helps the entity config parse data generate entity definitions.


importEntityConfigDelegate

protected ImportEntityConfigDelegate importEntityConfigDelegate
The delegate that helps the entity config parse import entity definitions.


exportEntityConfigDelegate

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

Constructor Detail

GenerateConfig

public GenerateConfig()
Constructs an GenerateConfig.

Method Detail

setConnectionDefFactory

public void setConnectionDefFactory(CustomObjectFactory newFactory)
Sets the ConnectionDefFactory to use when creating an GenerateDef.

Parameters:
newFactory - the connection definition factory

setDelimiterFormatterFactory

public void setDelimiterFormatterFactory(CustomObjectFactory newFactory)
Sets the DelimiterFormatterFactory to use when creating EntityDef(s).

Parameters:
newFactory - the delimiter formatter factory

setDelimiterParserFactory

public void setDelimiterParserFactory(CustomObjectFactory newFactory)
Sets the DelimiterParserFactory to use when creating EntityDef(s).

Parameters:
newFactory - the delimiter parser factory

setBinaryDelimiterParserFactory

public void setBinaryDelimiterParserFactory(CustomObjectFactory newFactory)
Sets the BinaryDelimiterParserFactory to use when creating EntityDef(s).

Parameters:
newFactory - the binary delimiter parser factory
Since:
0.74

setColumnValueGeneratorFactory

public void setColumnValueGeneratorFactory(CustomObjectFactory newFactory)
Sets the ColumnValueGeneratorFactory to use when creating EntityDef(s).

Parameters:
newFactory - the column value generator factory

setColumnTranslatorFactory

public void setColumnTranslatorFactory(CustomObjectFactory newFactory)
Sets the ColumnTranslatorFactory to use when creating EntityDef(s).

Parameters:
newFactory - the column translator factory

getGenerate

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

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

initConnection

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

Parameters:
generateDef - the generate definition
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

getEntityConfig

protected EntityConfig getEntityConfig(org.w3c.dom.Node entity)
Returns the correct EntityConfig that can handle parsing the given node.

Parameters:
entity - the node representing the entity
Returns:
the entity config that can create the EntityDef