public interface Loader
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
getClassConfig()
Returns a PropertyGroup used to globally configure a class of Loader.
|
SamplePrinter |
getConfigSamplePrinter()
Returns a ConfigSamplePrinter, which can be used to print a configuration
sample for this Loader.
|
List<Property> |
getInstanceConfig()
A list of properties that the user has specified as being configuration
properties for this Loader.
|
String |
getLoaderDialect()
The type dialect of the loader.
|
String |
getLoaderType()
The type of the loader, such as JNDI, PropertyFile, SystemProperty,
etc..
|
String |
getSpecificLoadDescription()
For this particular load, where was info loaded from?
This may vary from run to run based on config params.
|
boolean |
isFlaggable()
Returns true if this loader supports
FlaggableType's. |
boolean |
isTrimmingRequiredForStringValues()
If true, values for string properties are trimmed by the Trimmer of
the property they are associated with.
|
LoaderValues |
load(PropertyConfigurationInternal runtimeDef,
LoaderEnvironment environment,
ValidatedValuesWithContext existingValues)
Builds up a list of LoaderValues by loading property values from a configuration source.
|
void |
releaseResources()
Release any resources held by this loader.
|
LoaderValues load(PropertyConfigurationInternal runtimeDef, LoaderEnvironment environment, ValidatedValuesWithContext existingValues)
Loaders find and load values and associate them with the correct Property. If there is a problem while doing that, they register one or more LoaderProblems in the returned LoaderValues.
Validation of Property values is not Loader's responsibility and will be handled outside this method.
runtimeDef - The definition of all known Properties and naming metadata.environment - The environment (System Props, Env vars, fixed values) as
known to the Loader.existingValues - The values already set by prior loaders, which may configure
the behavior of this loader.Class<?> getClassConfig()
List<Property> getInstanceConfig()
String getSpecificLoadDescription()
boolean isTrimmingRequiredForStringValues()
boolean isFlaggable()
FlaggableType's.
Loaders that support FlaggableType give special 'is present' meaning to a property being
present without a value, similar to a 'nix command line flag. If a Loader supports
flags, it should call FlaggableType.parseFlag(String) instead of
ValueType.parse(String) when a Property's ValueType is a FlaggableType.
See FlagProp for an example type.
Note: Returning true from this method is only potentially applicable to Loaders that parse strings. Loaders that directly load from rich values do not parse, so the loader logic would ignore the value here.
Examples:
Loading a non-null value from the properties file entry 'name = ' would be unexpected,
so a properties file Loader should return 'false' here.
However, a command line loader would be expected to support flags, so should return 'true'.
SamplePrinter getConfigSamplePrinter()
String getLoaderType()
String getLoaderDialect()
void releaseResources()
Copyright © 2022. All rights reserved.