Class ConfigBase
- java.lang.Object
-
- de.julielab.costosys.configuration.ConfigBase
-
- Direct Known Subclasses:
DBConfig,FieldConfig
public abstract class ConfigBase extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerLOG
-
Constructor Summary
Constructors Constructor Description ConfigBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]extractConfigData(byte[] confData, java.lang.String xpath)Retrieves XML elements (determined by the used path) from the configuration.static java.lang.StringgetActiveConfig(byte[] data, java.lang.String activePath)Used to determine which of the elements in the configuration file is set as active.protected java.lang.StringstringFromXpath(com.ximpleware.AutoPilot ap, java.lang.String xpath)Used to get an element by its relative xpath.
-
-
-
Method Detail
-
extractConfigData
protected byte[] extractConfigData(byte[] confData, java.lang.String xpath) throws java.io.IOException, com.ximpleware.VTDExceptionRetrieves XML elements (determined by the used path) from the configuration.- Parameters:
confData- - prepared XMLxpath- - path to the retrieved configuration element- Returns:
- - the retrieved element
- Throws:
java.io.IOExceptioncom.ximpleware.VTDException
-
getActiveConfig
public static java.lang.String getActiveConfig(byte[] data, java.lang.String activePath) throws java.io.IOException, com.ximpleware.VTDExceptionUsed to determine which of the elements in the configuration file is set as active.- Parameters:
data- - the configuration fileactivePath- - xpath to the element which defines the active configuration- Returns:
- - the name of the active configuration
- Throws:
java.io.IOExceptioncom.ximpleware.VTDException
-
stringFromXpath
protected java.lang.String stringFromXpath(com.ximpleware.AutoPilot ap, java.lang.String xpath) throws com.ximpleware.XPathParseExceptionUsed to get an element by its relative xpath.- Parameters:
ap- - a vtd autopilotxpath- - xpath to the element which shall be returned- Returns:
- - String representation of the element
- Throws:
com.ximpleware.XPathParseException
-
-