net.sourceforge.jdbcimporter.ant
Class ColumnDefElement

java.lang.Object
  extended bynet.sourceforge.jdbcimporter.ant.ColumnDefElement
Direct Known Subclasses:
ExportColumnDefElement

public class ColumnDefElement
extends java.lang.Object

The ColumnDefElement provides an Ant wrapper for setting a ColumnDef object from Ant.

Version:
0.6
Author:
Chris Nagy

Field Summary
protected  ColumnDef columnDef
          The wrapped column definition.
 
Constructor Summary
ColumnDefElement()
           
 
Method Summary
 void addConfiguredProperty(PropertyElement element)
          Adds a configured property element to the column def.
 ColumnDef getColumnDef()
          Returns the column definition.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

columnDef

protected ColumnDef columnDef
The wrapped column definition.

Constructor Detail

ColumnDefElement

public ColumnDefElement()
Method Detail

getColumnDef

public ColumnDef getColumnDef()
                       throws org.apache.tools.ant.BuildException
Returns the column definition.

Returns:
the column definition
Throws:
org.apache.tools.ant.BuildException - if the column definition's name has not been set.

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