Class ConfigReader
- java.lang.Object
-
- de.julielab.costosys.configuration.ConfigReader
-
public class ConfigReader extends Object
This class reads an xml configuration file, containing the definition of a database connection and the fields used in the database. It provides those definitions as specialized objects.- Author:
- hellrich
-
-
Field Summary
Fields Modifier and Type Field Description static StringXPATH_TYPE_SYSTEMstatic StringXPATH_TYPE_SYSTEM_FILE
-
Constructor Summary
Constructors Constructor Description ConfigReader(InputStream def)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetActiveDataSchema()StringgetActiveDataTable()StringgetActiveSchemaName()DBConfiggetDatabaseConfig()Accessing the Database ConfigurationFieldConfigurationManagergetFieldConfigs()Accessing the Field Definitions.byte[]getMergedConfigData()List<String>getTableSchemaNames()List<File>getTypeSystemFiles()protected List<String>getTypeSystemPaths(byte[] mergedConfigData)Returns the type system files from the configuration.
-
-
-
Field Detail
-
XPATH_TYPE_SYSTEM
public static final String XPATH_TYPE_SYSTEM
- See Also:
- Constant Field Values
-
XPATH_TYPE_SYSTEM_FILE
public static final String XPATH_TYPE_SYSTEM_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConfigReader
public ConfigReader(InputStream def)
-
-
Method Detail
-
getTypeSystemPaths
protected List<String> getTypeSystemPaths(byte[] mergedConfigData) throws com.ximpleware.XPathParseException, CoStoSysException
Returns the type system files from the configuration.- Parameters:
mergedConfigData-- Returns:
- - String representations of the elements
- Throws:
com.ximpleware.XPathParseExceptionCoStoSysException
-
getDatabaseConfig
public DBConfig getDatabaseConfig()
Accessing the Database Configuration- Returns:
- - DatabaseConfig Object
-
getFieldConfigs
public FieldConfigurationManager getFieldConfigs()
Accessing the Field Definitions.
The returned map consists of pairs in the form
(schemaName, fieldConfig)whereschemaNameis the name of the table schema represented byfieldConfig.- Returns:
- - A map containing all table schemas in the default and in the user configuration.
-
getActiveDataTable
public String getActiveDataTable()
- Returns:
- the activeDataTable
-
getActiveDataSchema
public String getActiveDataSchema()
-
getActiveSchemaName
public String getActiveSchemaName()
- Returns:
- the activeSchemaName
-
getMergedConfigData
public byte[] getMergedConfigData()
- Returns:
- the mergedConfigData
-
-