Package com.caplin.datasource
Interface DataSourceConfiguration
public interface DataSourceConfiguration
This interface allows public access to values inside a DataSource configuration file. To access each element, simply
pass the field name as a parameter and its value will be returned.
Each value in the configuration file has an implicit type. To return that type, call the corresponding method (NB all values can be returned as Strings). For more information on value types, refer to other Caplin documentation (eg Liberator Administration Guide).
-
Method Summary
Modifier and TypeMethodDescriptiongetBooleanArrayValue(String fieldName) Accesses the configuration file and returns the value of the requested field as anListofBoolean.booleangetBooleanValue(String fieldName) Accesses the configuration file and returns the value of the requested field as aboolean.booleangetBooleanValue(String fieldName, boolean defaultValue) Accesses the configuration file and returns the value of the requested field as aboolean.getConfigurationBlocksByName(String blockName) Accesses the configuration file and returns the Configuration Block(s) of blockName with list, return as List of DataSourceConfiguration Object E.G a add-log configuration block would be accessed by passing in a blackName value of "logList"getDoubleArrayValue(String fieldName) Accesses the configuration file and returns the value of the requested field as aListofDouble.doublegetDoubleValue(String fieldName) Accesses the configuration file and returns the value of the requested field as adouble.doublegetDoubleValue(String fieldName, double defaultValue) Accesses the configuration file and returns the value of the requested field as adouble.getIntegerArrayValue(String fieldName) Accesses the configuration file and returns the value of the requested field as anListofInteger.intgetIntValue(String fieldName) Accesses the configuration file and returns the value of the requested field as anint.intgetIntValue(String fieldName, int defaultValue) Accesses the configuration file and returns the value of the requested field as aint.getStringArrayValue(String fieldName) Accesses the configuration file and returns the value of the requested field as anListofString.getStringArrayValueExpanded(String fieldName) Accesses the configuration file and returns the value of the requested field as anListofString.getStringValue(String fieldName) Accesses the configuration file and returns the value of the requested field as astring.getStringValue(String fieldName, String defaultValue) Accesses the configuration file and returns the last value of the requested field as astring.getStringValueExpanded(String fieldName) Accesses the configuration file and returns the last value of the requested field as astring.getStringValueExpanded(String fieldName, String defaultValue) Accesses the configuration file and returns the last value of the requested field as astring.toPrettyString(StringBuilder builder, String indent) Create a formattedStringrepresentation of this configuration node
-
Method Details
-
getBooleanValue
Accesses the configuration file and returns the value of the requested field as aboolean.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
boolean.falseas default.
-
getBooleanValue
Accesses the configuration file and returns the value of the requested field as aboolean.- Parameters:
fieldName- name of the field in the configuration file.defaultValue- defaultValue to be used if there is no configuration value.- Returns:
- value parsed as a
booleanordefaultValueif no value exists.
-
getIntValue
Accesses the configuration file and returns the value of the requested field as anint.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as an
int.-1as default
-
getIntValue
Accesses the configuration file and returns the value of the requested field as aint.- Parameters:
fieldName- name of the field in the configuration file.defaultValue- defaultValue to be used if there is no configuration value.- Returns:
- value parsed as a
intordefaultValueif no value exists.
-
getDoubleValue
Accesses the configuration file and returns the value of the requested field as adouble.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
double.-1.0as default.
-
getDoubleValue
Accesses the configuration file and returns the value of the requested field as adouble.- Parameters:
fieldName- name of the field in the configuration file.defaultValue- defaultValue to be used if there is no configuration value.- Returns:
- value parsed as a
doubleordefaultValueif no value exists.
-
getStringValue
Accesses the configuration file and returns the value of the requested field as astring.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
string. EmptyStringas default.
-
getStringValue
Accesses the configuration file and returns the last value of the requested field as astring. Note this value is interpolated with System properties.- Parameters:
fieldName- name of the field in the configuration file.defaultValue- defaultValue to be used if there is no configuration value.- Returns:
- value parsed as a
doubleordefaultValueif no value exists.
-
getStringValueExpanded
Accesses the configuration file and returns the last value of the requested field as astring. Note this value is interpolated with System properties.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
double. EmptyStringas default.
-
getStringValueExpanded
Accesses the configuration file and returns the last value of the requested field as astring. Note this value is interpolated with System properties.- Parameters:
fieldName- name of the field in the configuration file.defaultValue- defaultValue to be used if there is no configuration value.- Returns:
- value parsed as a
doubleordefaultValueif no value exists.
-
getStringArrayValue
Accesses the configuration file and returns the value of the requested field as anListofString.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
String. EmptyListas default.
-
getStringArrayValueExpanded
Accesses the configuration file and returns the value of the requested field as anListofString. Note this value is interpolated with System properties.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
String. EmptyListas default.
-
getBooleanArrayValue
Accesses the configuration file and returns the value of the requested field as anListofBoolean.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
Boolean. EmptyListas default.
-
getIntegerArrayValue
Accesses the configuration file and returns the value of the requested field as anListofInteger.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as an
Integer. EmptyListas default.
-
getDoubleArrayValue
Accesses the configuration file and returns the value of the requested field as aListofDouble.- Parameters:
fieldName- name of the field in the configuration file.- Returns:
- value parsed as a
Double. EmptyListas default.
-
getConfigurationBlocksByName
Accesses the configuration file and returns the Configuration Block(s) of blockName with list, return as List of DataSourceConfiguration Object E.G a add-log configuration block would be accessed by passing in a blackName value of "logList"- Parameters:
blockName- the name of the config block- Returns:
- the configuration parent block
-
toPrettyString
Create a formattedStringrepresentation of this configuration node- Parameters:
builder- the builder to append the data to.indent- the indent value to use.- Returns:
- formatted
Stringrepresentation of this configuration node.
-
getAppName
String getAppName()
-