net.sourceforge.datagenerator.ant
Class DelegateColumnDefElement

java.lang.Object
  extended bynet.sourceforge.datagenerator.ant.DelegateColumnDefElement

public class DelegateColumnDefElement
extends java.lang.Object

The DelegateColumnDefElement provides an Ant wrapper for creating a ColumnDef object from Ant. The ColumnDef could be one of three types: GenerateColumnDef, ImportColumnDef and ExportColumnDef.

Version:
0.69
Author:
Chris Nagy

Field Summary
protected  java.util.Map plugins
          The plugin mapping for custom types and classes.
 
Constructor Summary
DelegateColumnDefElement(java.util.Map plugins)
          Creates a DelegateColumnDefElement with the given mapping between custom types and implementations.
 
Method Summary
 void addConfiguredProperty(PropertyElement element)
          Adds a configured property element to the column def.
 ColumnDef createColumnDef(int entityDefType)
          Creates a ColumnDef based on the given entity type (ie.
 ColumnValueGeneratorElement createGenerator()
          Returns a new column value generator element.
 ColumnTranslatorElement createTranslator()
          Returns a new column value generator element.
 void setDefaultValue(java.lang.String newDefaultValue)
          Sets the default value of the column.
 void setFormat(java.lang.String pattern)
          Sets the format pattern used when parsing the data in the file.
 void setName(java.lang.String newName)
          Sets the name of the column.
 void setSQLType(java.lang.String newType)
          Sets the sql type of the column.
 void setTranslator(java.lang.String className)
          Sets the column translator used on every row's column value during the import.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugins

protected java.util.Map plugins
The plugin mapping for custom types and classes.

Constructor Detail

DelegateColumnDefElement

public DelegateColumnDefElement(java.util.Map plugins)
Creates a DelegateColumnDefElement with the given mapping between custom types and implementations.

Parameters:
plugins - the plugin mappings
Method Detail

setName

public void setName(java.lang.String newName)
Sets the name of the column.

Parameters:
newName - name of the column

setSQLType

public void setSQLType(java.lang.String newType)
Sets the sql type of the column.

Parameters:
newType - name (case-insensitive) of the sql type that equals the name of a static variable defined in java.sql.Types

setDefaultValue

public void setDefaultValue(java.lang.String newDefaultValue)
Sets the default value of the column. The default value of the column is applied when a row's column value is null or an empty String.

Parameters:
newDefaultValue - default value for this column

setFormat

public void setFormat(java.lang.String pattern)
Sets the format pattern used when parsing the data in the file. The pattern syntax is taken from java.text.SimpleDataFormat for date, time, and timestamp column types.

Parameters:
pattern - the format pattern

addConfiguredProperty

public void addConfiguredProperty(PropertyElement element)
Adds a configured property element to the column def. The property element must have a non-null name and value.

Parameters:
element - the property element

createGenerator

public ColumnValueGeneratorElement createGenerator()
Returns a new column value generator element.

Returns:
new column value generator

setTranslator

public void setTranslator(java.lang.String className)
Sets the column translator used on every row's column value during the import.

Parameters:
className - column translator

createTranslator

public ColumnTranslatorElement createTranslator()
Returns a new column value generator element.

Returns:
new column value generator

createColumnDef

public ColumnDef createColumnDef(int entityDefType)
Creates a ColumnDef based on the given entity type (ie. if the entity type is DATAGENERATE_ENTITY_DEF then a GenerateColumnDef is created).

Parameters:
entityDefType - the entity type
Returns:
the ColumnDef