|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fesenmeyer.dbnormalizer.core.configuration.ConfigurationReader
public class ConfigurationReader
Class which reads a session configuration from a XML file. Such a file contains FDs grouped by schema, catalog and table.
Either a DB-Configuration for reading table information from a DB or attributes for each table are also contained in the file.
A standard DB-Normalizer-file can be read with the read()
method. To import FDs from Tobias Rafreiders tool "Tane-java",
which uses a slightly different format, you can use the method readTaneJavaConfig()
.
ConfigurationWriter
,
SessionConfig
Field Summary | |
---|---|
private String |
fileName
The name (and path) of the file to be read. |
private boolean |
hasDBConfig
Flag which states whether the file contains a DB-Configuration or not. |
private static DBNormalizerLogger |
logger
The logger for this class. |
Constructor Summary | |
---|---|
ConfigurationReader(String fileName)
Class constructor specifying the file to be read. |
Method Summary | |
---|---|
SessionConfig |
read()
Reads the configuration file into a session configuration object. |
SessionConfig |
readTaneJavaConfig()
Can be used to import FDs from Tobias Rafreider's tool "TANE-java". |
private AttributeSetConfig |
retrieveAttributes(Element attributeSetNode)
Reads the (table) attributes from a node containing (table) attributes. |
private Collection<TableContainerConfig> |
retrieveCatalogConfigs(Element parentNode)
Reads the data from a catalog node. |
private DBConfig |
retrieveDBConfig(Element dbConfigElement)
Reads the dbConfig node into a DB-Configuration object. |
private Collection<FDConfig> |
retrieveFDConfigs(Element fdsNode)
Reads the FDs from a fds node. |
private Collection<TableContainerConfig> |
retrieveSchemaConfigs(Element parentNode)
Reads the data from a schema node. |
private SessionConfig |
retrieveSessionConfig(Element configNode)
Reads the whole file into a session configuration object. |
private Collection<TableConfig> |
retrieveTableConfigs(Element tableInfoNode,
String catalogName,
String schemaName)
Reads the (tables') data from a tableInfo node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static DBNormalizerLogger logger
private String fileName
private boolean hasDBConfig
Constructor Detail |
---|
public ConfigurationReader(String fileName)
fileName
- the name (and) path of the file to be readMethod Detail |
---|
public SessionConfig read() throws ConfigurationException
ConfigurationException
- if an exception occurs while reading
the file, e.g. if it is not validpublic SessionConfig readTaneJavaConfig() throws ConfigurationException
ConfigurationException
- if an exception occurs during transformation or validation
of the fileprivate SessionConfig retrieveSessionConfig(Element configNode) throws ConfigurationException
configNode
- the root node of the file
ConfigurationException
private DBConfig retrieveDBConfig(Element dbConfigElement)
dbConfig
node into a DB-Configuration object.
dbConfigElement
- the dbConfig
node
private Collection<TableContainerConfig> retrieveSchemaConfigs(Element parentNode) throws ConfigurationException
schema
node.
parentNode
- the parent node of the schema
node
TableContainerConfig
objects
ConfigurationException
private Collection<TableContainerConfig> retrieveCatalogConfigs(Element parentNode) throws ConfigurationException
catalog
node.
parentNode
- the parent node of the catalog
node
TableContainerConfig
objects
ConfigurationException
private Collection<TableConfig> retrieveTableConfigs(Element tableInfoNode, String catalogName, String schemaName) throws ConfigurationException
tableInfo
node.
tableInfoNode
- the tableInfo
nodecatalogName
- the name of the catalog containing the tables, may be null
schemaName
- the name of the schema containing the tables, may be null
TableConfig
objects
ConfigurationException
private Collection<FDConfig> retrieveFDConfigs(Element fdsNode)
fds
node.
fdsNode
- the fds
node
FDConfig
objectsprivate AttributeSetConfig retrieveAttributes(Element attributeSetNode)
attributeSetNode
- the node containing (table) attributes
AttributeSetConfig
object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |