|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.jdbcimporter.config.ImportConfig
The ImportConfig class parses a Node to create an ImportDef. The Node's name must be 'import'.
Field Summary | |
static java.lang.String |
BATCH_COUNT_ATTR
The attribute name in the IMPORT_TAG element that contains the number of records to import before executing batch update. |
static java.lang.String |
COMMIT_COUNT_ATTR
The attribute name in the IMPORT_TAG element that contains the number of records to import before commiting. |
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
Custom object factory that creates connection definitions. |
static java.lang.String |
ENTITY_TAG
The element name that contains the EntityDef. |
protected EntityConfig |
entityConfig
The entity config used to create entity definitions from XML nodes. |
protected ImportEntityConfigDelegate |
entityConfigDelegate
The entity config delegate. |
static java.lang.String |
IMPORT_TAG
The element name that contains the ImportDef. |
static java.lang.String |
LOG_BAD_ATTR
The attribute name in the IMPORT_TAG element that contains the filename of the log file to write bad data. |
static java.lang.String |
LOG_FILE_ATTR
The attribute name in the IMPORT_TAG element that contains the filename of the log file. |
static java.lang.String |
POST_SQL_FILE_ATTR
The attribute name in the IMPORT_TAG element that contains the filename of the sql script file that will be executed after the import. |
static java.lang.String |
PRE_SQL_FILE_ATTR
The attribute name in the IMPORT_TAG element that contains the filename of the sql script file that will be executed before the import. |
static java.lang.String |
PROPERTY_NAME_ATTR
The attribute name in the PROPERTY_TAG element that contains the name of the custom property. |
static java.lang.String |
PROPERTY_TAG
The element name that contains a custom property. |
static java.lang.String |
PROPERTY_VALUE_ATTR
The attribute name in the PROPERTY_TAG element that contains the value of the custom property. |
static java.lang.String |
TRIM_VALUES_ATTR
The attribute name in the IMPORT_TAG element that contains the flag indicating that values should be trimmed after being read with the delimiter parser. |
Constructor Summary | |
ImportConfig()
Constructs an ImportConfig. |
Method Summary | |
static void |
assertNodeName(java.lang.String nodeName,
org.w3c.dom.Node node)
Asserts that the given node has the given name. |
static org.w3c.dom.Node |
getFirstElementChild(org.w3c.dom.Node parent)
Returns the first element child of the given node. |
static org.w3c.dom.Node |
getFirstElementChild(org.w3c.dom.Node parent,
java.lang.String name)
Returns the first element child of the given node with the given name. |
ImportDef |
getImport(org.w3c.dom.Node node)
Returns the ImportDef defined in the given Node. |
static org.w3c.dom.Node |
getNextElementSibling(org.w3c.dom.Node sibling)
Returns the next element sibling of the given node. |
static java.lang.String |
getNodeValue(org.w3c.dom.Node node)
Returns the first child's value of the given node. |
static java.util.Map |
getProperties(org.w3c.dom.NodeList properties)
Returns a map of all the property elements found in the given node list. |
protected void |
initConnection(ImportDef importDef,
org.w3c.dom.Node connection)
Initializes the connection definition from the XML node. |
void |
setBinaryDelimiterParserFactory(CustomObjectFactory newFactory)
Sets the BinaryDelimiterParser factory to use when creating EntityDef(s). |
void |
setColumnTranslatorFactory(CustomObjectFactory newFactory)
Sets the ColumnTranslator factory to use when creating ColumnDef(s). |
void |
setColumnValueGeneratorFactory(CustomObjectFactory newFactory)
Sets the ColumnValueGeneratorFactory to use when creating ColumnDef(s). |
void |
setConnectionDefFactory(CustomObjectFactory newFactory)
Sets the ConnectionDef factory to use when creating an ImportDef. |
void |
setDelimiterParserFactory(CustomObjectFactory newFactory)
Sets the DelimiterParser factory to use when creating EntityDef(s). |
void |
setRowTranslatorFactory(CustomObjectFactory newFactory)
Sets the RowTranslatorFactory 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 |
public static final java.lang.String IMPORT_TAG
public static final java.lang.String CONNECTION_TAG
public static final java.lang.String CONNECTION_TYPE_ATTR
public static final java.lang.String PROPERTY_TAG
public static final java.lang.String PROPERTY_NAME_ATTR
public static final java.lang.String PROPERTY_VALUE_ATTR
public static final java.lang.String LOG_FILE_ATTR
public static final java.lang.String LOG_BAD_ATTR
public static final java.lang.String PRE_SQL_FILE_ATTR
public static final java.lang.String POST_SQL_FILE_ATTR
public static final java.lang.String TRIM_VALUES_ATTR
public static final java.lang.String ENTITY_TAG
public static final java.lang.String BATCH_COUNT_ATTR
public static final java.lang.String COMMIT_COUNT_ATTR
protected CustomObjectFactory connectionDefFactory
protected EntityConfig entityConfig
protected ImportEntityConfigDelegate entityConfigDelegate
Constructor Detail |
public ImportConfig()
Method Detail |
public void setConnectionDefFactory(CustomObjectFactory newFactory)
newFactory
- the connection definition factorypublic void setDelimiterParserFactory(CustomObjectFactory newFactory)
newFactory
- the delimiter parser factorypublic void setBinaryDelimiterParserFactory(CustomObjectFactory newFactory)
newFactory
- the binary delimiter parser factorypublic void setColumnTranslatorFactory(CustomObjectFactory newFactory)
newFactory
- the column translator factorypublic void setColumnValueGeneratorFactory(CustomObjectFactory newFactory)
newFactory
- the column value generator factorypublic void setRowTranslatorFactory(CustomObjectFactory newFactory)
newFactory
- the row translator factorypublic ImportDef getImport(org.w3c.dom.Node node) throws org.w3c.dom.DOMException, InvalidCustomObjectDefException
node
- the Node
org.w3c.dom.DOMException
- if the Node has missing or invalid attributes/elements
InvalidCustomObjectDefException
- if a custom object could not
be created from their respective factoriespublic static void assertNodeName(java.lang.String nodeName, org.w3c.dom.Node node) throws org.w3c.dom.DOMException
nodeName
- the name of node expectednode
- the node
org.w3c.dom.DOMException
- if the node is null or doesn't have the given namepublic static org.w3c.dom.Node getFirstElementChild(org.w3c.dom.Node parent)
parent
- the node
public static org.w3c.dom.Node getNextElementSibling(org.w3c.dom.Node sibling)
sibling
- the node
public static org.w3c.dom.Node getFirstElementChild(org.w3c.dom.Node parent, java.lang.String name)
parent
- the nodename
- the child node name
public static java.lang.String getNodeValue(org.w3c.dom.Node node) throws org.w3c.dom.DOMException
node
- the node
org.w3c.dom.DOMException
- if the node does not have a child or the first child's
value is "".protected void initConnection(ImportDef importDef, org.w3c.dom.Node connection) throws org.w3c.dom.DOMException, InvalidCustomObjectDefException
importDef
- the import definition to add the connectionconnection
- the node
org.w3c.dom.DOMException
- if the node has missing attributes/elements
InvalidCustomObjectDefException
- if the connection definition
could not be created from the connection definition factorypublic static java.util.Map getProperties(org.w3c.dom.NodeList properties)
properties
- the node list containing property elements
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |