net.sourceforge.jdbcimporter.config
Class EntityConfig

java.lang.Object
  extended bynet.sourceforge.jdbcimporter.config.EntityConfig

public class EntityConfig
extends java.lang.Object

The EntityConfig class parses a Node to create an EntityDef. The Node's name must be 'entity'.

Version:
0.6
Author:
Chris Nagy

Field Summary
static java.lang.String COLUMN_DEFAULT_ATTR
          The attribute name in the COLUMN_TAG element that contains the default value of the column.
static java.lang.String COLUMN_FORMAT_ATTR
          The attribute name in the COLUMN_TAG element that contains the format pattern of the column (only used for date, time and timestamp columns).
static java.lang.String COLUMN_NAME_ATTR
          The attribute name in the COLUMN_TAG element that contains the name of the column.
static java.lang.String COLUMN_PROPERTY_NAME_ATTR
          The attribute name in the COLUMN_PROPERTY_TAG element that contains the name of the property.
static java.lang.String COLUMN_PROPERTY_TAG
          The element name that contains the column properties.
static java.lang.String COLUMN_PROPERTY_VALUE_ATTR
          The attribute name in the COLUMN_PROPERTY_TAG element that contains the value of the property.
static java.lang.String COLUMN_SQLTYPE_ATTR
          The attribute name in the COLUMN_TAG element that contains the type of the column.
static java.lang.String COLUMN_TAG
          The element name that contains the ColumnDef.
protected  EntityConfigDelegate delegate
          The delegate that handles creation of EntityDef and ColumnDef objects.
static java.lang.String ENTITY_CATALOG_ATTR
          The attribute name that contains the name of the catalog.
static java.lang.String ENTITY_PROPERTY_NAME_ATTR
          The attribute name in the ENTITY_PROPERTY_TAG element that contains the name of the property.
static java.lang.String ENTITY_PROPERTY_TAG
          The element name that contains the entity properties.
static java.lang.String ENTITY_PROPERTY_VALUE_ATTR
          The attribute name in the ENTITY_PROPERTY_TAG element that contains the value of the property.
static java.lang.String ENTITY_SCHEMA_ATTR
          The attribute name that contains the name of the schema.
static java.lang.String ENTITY_TABLE_ATTR
          The attribute name that contains the name of the table.
 
Constructor Summary
EntityConfig()
           
 
Method Summary
protected  void addColumn(EntityDef entityDef, org.w3c.dom.Node column)
          Add a column represented by the XML node to the entity def.
 EntityDef getEntity(org.w3c.dom.Node node)
          Returns the EntityDef defined in the given Node.
 void setDelegate(EntityConfigDelegate delegate)
          Set the delegate that handles creation of EntityDef and ColumnDef objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITY_CATALOG_ATTR

public static final java.lang.String ENTITY_CATALOG_ATTR
The attribute name that contains the name of the catalog.

See Also:
Constant Field Values

ENTITY_SCHEMA_ATTR

public static final java.lang.String ENTITY_SCHEMA_ATTR
The attribute name that contains the name of the schema.

See Also:
Constant Field Values

ENTITY_TABLE_ATTR

public static final java.lang.String ENTITY_TABLE_ATTR
The attribute name that contains the name of the table.

See Also:
Constant Field Values

COLUMN_TAG

public static final java.lang.String COLUMN_TAG
The element name that contains the ColumnDef.

See Also:
Constant Field Values

COLUMN_NAME_ATTR

public static final java.lang.String COLUMN_NAME_ATTR
The attribute name in the COLUMN_TAG element that contains the name of the column.

See Also:
Constant Field Values

COLUMN_SQLTYPE_ATTR

public static final java.lang.String COLUMN_SQLTYPE_ATTR
The attribute name in the COLUMN_TAG element that contains the type of the column.

See Also:
Constant Field Values

COLUMN_FORMAT_ATTR

public static final java.lang.String COLUMN_FORMAT_ATTR
The attribute name in the COLUMN_TAG element that contains the format pattern of the column (only used for date, time and timestamp columns).

See Also:
Constant Field Values

COLUMN_DEFAULT_ATTR

public static final java.lang.String COLUMN_DEFAULT_ATTR
The attribute name in the COLUMN_TAG element that contains the default value of the column.

See Also:
Constant Field Values

COLUMN_PROPERTY_TAG

public static final java.lang.String COLUMN_PROPERTY_TAG
The element name that contains the column properties.

See Also:
Constant Field Values

COLUMN_PROPERTY_NAME_ATTR

public static final java.lang.String COLUMN_PROPERTY_NAME_ATTR
The attribute name in the COLUMN_PROPERTY_TAG element that contains the name of the property.

See Also:
Constant Field Values

COLUMN_PROPERTY_VALUE_ATTR

public static final java.lang.String COLUMN_PROPERTY_VALUE_ATTR
The attribute name in the COLUMN_PROPERTY_TAG element that contains the value of the property.

See Also:
Constant Field Values

ENTITY_PROPERTY_TAG

public static final java.lang.String ENTITY_PROPERTY_TAG
The element name that contains the entity properties.

See Also:
Constant Field Values

ENTITY_PROPERTY_NAME_ATTR

public static final java.lang.String ENTITY_PROPERTY_NAME_ATTR
The attribute name in the ENTITY_PROPERTY_TAG element that contains the name of the property.

See Also:
Constant Field Values

ENTITY_PROPERTY_VALUE_ATTR

public static final java.lang.String ENTITY_PROPERTY_VALUE_ATTR
The attribute name in the ENTITY_PROPERTY_TAG element that contains the value of the property.

See Also:
Constant Field Values

delegate

protected EntityConfigDelegate delegate
The delegate that handles creation of EntityDef and ColumnDef objects.

Constructor Detail

EntityConfig

public EntityConfig()
Method Detail

setDelegate

public void setDelegate(EntityConfigDelegate delegate)
Set the delegate that handles creation of EntityDef and ColumnDef objects.

Parameters:
delegate - the delegate

getEntity

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

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

addColumn

protected void addColumn(EntityDef entityDef,
                         org.w3c.dom.Node column)
                  throws org.w3c.dom.DOMException,
                         InvalidCustomObjectDefException
Add a column represented by the XML node to the entity def.

Parameters:
entityDef - the entity definition
column - the node
Throws:
org.w3c.dom.DOMException - if the node has missing attributes/elements
InvalidCustomObjectDefException - if a custom object could not be created from their respective factories