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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getAppName()
java.util.List<java.lang.Boolean>
getBooleanArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as anList
ofBoolean
.boolean
getBooleanValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as aboolean
.boolean
getBooleanValue(java.lang.String fieldName, boolean defaultValue)
Accesses the configuration file and returns the value of the requested field as aboolean
.java.util.List<java.lang.Double>
getDoubleArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as aList
ofDouble
.double
getDoubleValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as adouble
.double
getDoubleValue(java.lang.String fieldName, double defaultValue)
Accesses the configuration file and returns the value of the requested field as adouble
.java.util.List<java.lang.Integer>
getIntegerArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as anList
ofInteger
.int
getIntValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as anint
.int
getIntValue(java.lang.String fieldName, int defaultValue)
Accesses the configuration file and returns the value of the requested field as aint
.java.util.List<java.lang.String>
getStringArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as anList
ofString
.java.util.List<java.lang.String>
getStringArrayValueExpanded(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as anList
ofString
.java.lang.String
getStringValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as astring
.java.lang.String
getStringValue(java.lang.String fieldName, java.lang.String defaultValue)
Accesses the configuration file and returns the last value of the requested field as astring
.java.lang.String
getStringValueExpanded(java.lang.String fieldName)
Accesses the configuration file and returns the last value of the requested field as astring
.java.lang.String
getStringValueExpanded(java.lang.String fieldName, java.lang.String defaultValue)
Accesses the configuration file and returns the last value of the requested field as astring
.java.lang.String
toPrettyString(java.lang.StringBuilder builder, java.lang.String indent)
-
-
-
Method Detail
-
getBooleanValue
boolean getBooleanValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as a
boolean
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
boolean
.false
as default.
-
getBooleanValue
boolean getBooleanValue(java.lang.String fieldName, boolean defaultValue)
Accesses the configuration file and returns the value of the requested field as a
boolean
.- 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
boolean
ordefaultValue
if no value exists.
-
getIntValue
int getIntValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as an
int
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as an
int
.-1
as default
-
getIntValue
int getIntValue(java.lang.String fieldName, int defaultValue)
Accesses the configuration file and returns the value of the requested field as a
int
.- 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
int
ordefaultValue
if no value exists.
-
getDoubleValue
double getDoubleValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as a
double
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
double
.-1.0
as default.
-
getDoubleValue
double getDoubleValue(java.lang.String fieldName, double defaultValue)
Accesses the configuration file and returns the value of the requested field as a
double
.- 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
double
ordefaultValue
if no value exists.
-
getStringValue
java.lang.String getStringValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as a
string
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
string
. EmptyString
as default.
-
getStringValue
java.lang.String getStringValue(java.lang.String fieldName, java.lang.String defaultValue)
Accesses the configuration file and returns the last value of the requested field as a
string
. 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
double
ordefaultValue
if no value exists.
-
getStringValueExpanded
java.lang.String getStringValueExpanded(java.lang.String fieldName)
Accesses the configuration file and returns the last value of the requested field as a
string
. Note this value is interpolated with System properties.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
double
. EmptyString
as default.
-
getStringValueExpanded
java.lang.String getStringValueExpanded(java.lang.String fieldName, java.lang.String defaultValue)
Accesses the configuration file and returns the last value of the requested field as a
string
. 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
double
ordefaultValue
if no value exists.
-
getStringArrayValue
java.util.List<java.lang.String> getStringArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as an
List
ofString
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
String
. EmptyList
as default.
-
getStringArrayValueExpanded
java.util.List<java.lang.String> getStringArrayValueExpanded(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as an
List
ofString
. Note this value is interpolated with System properties.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
String
. EmptyList
as default.
-
getBooleanArrayValue
java.util.List<java.lang.Boolean> getBooleanArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as an
List
ofBoolean
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
Boolean
. EmptyList
as default.
-
getIntegerArrayValue
java.util.List<java.lang.Integer> getIntegerArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as an
List
ofInteger
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as an
Integer
. EmptyList
as default.
-
getDoubleArrayValue
java.util.List<java.lang.Double> getDoubleArrayValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of the requested field as a
List
ofDouble
.- Parameters:
fieldName
- name of the field in the configuration file.- Returns:
- value parsed as a
Double
. EmptyList
as default.
-
toPrettyString
java.lang.String toPrettyString(java.lang.StringBuilder builder, java.lang.String indent)
String
representation of this configuration node- Parameters:
builder
- the builder to append the data to.indent
- the indent value to use.- Returns:
- formatted
String
representation of this configuration node.
-
getAppName
java.lang.String getAppName()
-
-