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).
Modifier and Type | Method and 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 an
List of Boolean . |
boolean |
getBooleanValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as a
boolean . |
boolean |
getBooleanValue(java.lang.String fieldName,
boolean defaultValue)
Accesses the configuration file and returns the value of
the requested field as a
boolean . |
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 of Double . |
double |
getDoubleValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as a
double . |
double |
getDoubleValue(java.lang.String fieldName,
double defaultValue)
Accesses the configuration file and returns the value of
the requested field as a
double . |
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 of Integer . |
int |
getIntValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as an
int . |
int |
getIntValue(java.lang.String fieldName,
int defaultValue)
Accesses the configuration file and returns the value of
the requested field as a
int . |
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 of String . |
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 of String . |
java.lang.String |
getStringValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as a
string . |
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 . |
java.lang.String |
getStringValueExpanded(java.lang.String fieldName)
Accesses the configuration file and returns the last value of
the requested field as a
string . |
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 . |
java.lang.String |
toPrettyString(java.lang.StringBuilder builder,
java.lang.String indent)
|
boolean getBooleanValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as a boolean
.
fieldName
- name of the field in the configuration file.boolean
. false
as default.boolean getBooleanValue(java.lang.String fieldName, boolean defaultValue)
Accesses the configuration file and returns the value of
the requested field as a boolean
.
fieldName
- name of the field in the configuration file.defaultValue
- defaultValue to be used if there is no configuration value.boolean
or defaultValue
if no value exists.int getIntValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as an int
.
fieldName
- name of the field in the configuration file.int
. -1
as defaultint getIntValue(java.lang.String fieldName, int defaultValue)
Accesses the configuration file and returns the value of
the requested field as a int
.
fieldName
- name of the field in the configuration file.defaultValue
- defaultValue to be used if there is no configuration value.int
or defaultValue
if no value exists.double getDoubleValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as a double
.
fieldName
- name of the field in the configuration file.double
. -1.0
as default.double getDoubleValue(java.lang.String fieldName, double defaultValue)
Accesses the configuration file and returns the value of
the requested field as a double
.
fieldName
- name of the field in the configuration file.defaultValue
- defaultValue to be used if there is no configuration value.double
or defaultValue
if no value exists.java.lang.String getStringValue(java.lang.String fieldName)
Accesses the configuration file and returns the value of
the requested field as a string
.
fieldName
- name of the field in the configuration file.string
. Empty String
as default.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.
fieldName
- name of the field in the configuration file.defaultValue
- defaultValue to be used if there is no configuration value.double
or defaultValue
if no value exists.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.
fieldName
- name of the field in the configuration file.double
. Empty String
as default.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.
fieldName
- name of the field in the configuration file.defaultValue
- defaultValue to be used if there is no configuration value.double
or defaultValue
if no value exists.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
of String
.
fieldName
- name of the field in the configuration file.String
. Empty List
as default.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
of String
. Note this value is interpolated with
System properties.
fieldName
- name of the field in the configuration file.String
. Empty List
as default.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
of Boolean
.
fieldName
- name of the field in the configuration file.Boolean
. Empty List
as default.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
of Integer
.
fieldName
- name of the field in the configuration file.Integer
. Empty List
as default.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
of Double
.
fieldName
- name of the field in the configuration file.Double
. Empty List
as default.java.lang.String toPrettyString(java.lang.StringBuilder builder, java.lang.String indent)
Create a formatted
String
representation of this configuration nodebuilder
- the builder to append the data to.indent
- the indent value to use.String
representation of this configuration node.java.lang.String getAppName()
Please send bug reports and comments to Caplin support