C - The class to return from each of the fluent builder methods, which
will be the implementation class in each case. See StdConfig for an example.public abstract class BaseConfig<C extends BaseConfig<C>> extends Object implements AndHowConfiguration<C>
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_missingClasspathPropFileAProblem |
protected boolean |
_missingFilesystemPropFileAProblem |
protected StrProp |
classpathPropFilePathProp |
protected String |
classpathPropFilePathStr |
protected static Class<?>[] |
DEFAULT_LOADER_LIST |
protected StrProp |
filesystemPropFilePathProp |
protected Map<Class<? extends StandardLoader>,List<Loader>> |
insertAfter |
protected Map<Class<? extends StandardLoader>,List<Loader>> |
insertBefore |
protected LoaderEnvironmentBuilder |
loadEnvBuilder |
protected NamingStrategy |
naming |
protected List<Class<?>> |
overrideGroups
If non-null, overrides the default group discovery process with this override list.
|
protected List<Class<? extends StandardLoader>> |
standardLoaders |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseConfig()
Construct a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
List<Loader> |
buildLoaders() |
protected StdEnvVarLoader |
buildStdEnvVarLoader()
Build a StdEnvVarLoader, passing it the needed context.
|
protected StdFixedValueLoader |
buildStdFixedValueLoader()
Build a StdFixedValueLoader, passing it the needed context.
|
protected StdJndiLoader |
buildStdJndiLoader()
Build a StdJndiLoader, passing it the needed context.
|
protected StdMainStringArgsLoader |
buildStdMainStringArgsLoader()
Build a StdMainStringArgsLoader, passing it the needed context.
|
protected StdPropFileOnClasspathLoader |
buildStdPropFileOnClasspathLoader()
Build a StdPropFileOnClasspathLoader, passing it the needed context.
|
protected StdPropFileOnFilesystemLoader |
buildStdPropFileOnFilesystemLoader()
Build a StdPropFileOnFilesystemLoader, passing it the needed context.
|
protected StdSysPropLoader |
buildStdSysPropLoader()
Build a StdSysPropLoader, passing it the needed context.
|
List<Class<? extends StandardLoader>> |
getDefaultLoaderList()
The default list of standard loaders, as a list of Classes that implement
StandardLoader |
LoaderEnvironment |
getLoaderEnvironment()
Returns an immutable LoaderEnvironment with all collections fully expanded.
|
NamingStrategy |
getNamingStrategy()
Return the naming strategy used to form Property names, match them to values and display them.
|
List<GroupProxy> |
getRegisteredGroups()
Return a custom list of 'Groups' (classes or interfaces containing AndHow Properties)
to use instead of allowing the auto-discovery to find the Groups.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddFixedValue, addFixedValue, classpathPropertiesNotRequired, classpathPropertiesRequired, filesystemPropFileNotRequired, filesystemPropFileRequired, insertLoaderAfter, insertLoaderBefore, removeFixedValue, removeFixedValue, setClasspathPropFilePath, setClasspathPropFilePath, setCmdLineArgs, setFilesystemPropFilePath, setStandardLoaders, setStandardLoadersprotected static final Class<?>[] DEFAULT_LOADER_LIST
protected List<Class<? extends StandardLoader>> standardLoaders
protected Map<Class<? extends StandardLoader>,List<Loader>> insertBefore
protected Map<Class<? extends StandardLoader>,List<Loader>> insertAfter
protected LoaderEnvironmentBuilder loadEnvBuilder
protected String classpathPropFilePathStr
protected StrProp classpathPropFilePathProp
protected boolean _missingClasspathPropFileAProblem
protected StrProp filesystemPropFilePathProp
protected boolean _missingFilesystemPropFileAProblem
protected NamingStrategy naming
public NamingStrategy getNamingStrategy()
AndHowConfigurationCaseInsensitiveNaming is implemented.getNamingStrategy in interface AndHowConfiguration<C extends BaseConfig<C>>protected StdFixedValueLoader buildStdFixedValueLoader()
StandardLoader.protected StdMainStringArgsLoader buildStdMainStringArgsLoader()
StandardLoader.protected StdSysPropLoader buildStdSysPropLoader()
StandardLoader.protected StdJndiLoader buildStdJndiLoader()
StandardLoader.protected StdEnvVarLoader buildStdEnvVarLoader()
StandardLoader.protected StdPropFileOnFilesystemLoader buildStdPropFileOnFilesystemLoader()
StandardLoader.protected StdPropFileOnClasspathLoader buildStdPropFileOnClasspathLoader()
StandardLoader.public List<Loader> buildLoaders()
buildLoaders in interface AndHowConfiguration<C extends BaseConfig<C>>public List<GroupProxy> getRegisteredGroups()
AndHowConfigurationServiceLoader to discover all classes containing
AndHow Properties in conjunction with a generated manifest of those classes created at
compile time. Each class containing at least one AndHow Property is called a Group
and is represented by a GroupProxy object.
If this method returns non-null, then AndHow does not use this auto-discovery mechanism and just uses the returned list of GroupProxies. This is primarily for testing, where it is useful to test on only a small set of Groups and Properties.
Returning an empty list from this method would result in AndHow initializing with no registered Groups.
getRegisteredGroups in interface AndHowConfiguration<C extends BaseConfig<C>>public List<Class<? extends StandardLoader>> getDefaultLoaderList()
AndHowConfigurationStandardLoader
The returned list is disconnected from the actual list of loaders - it is intended to be a starting point for applications that want to modify the list, then call setStandardLoaders().
Unlike other methods of this class, it does not fluently return a method to itself, so your code will need a AndHowConfiguration instance reference to use it, eg:
public class MyAppInitiation implements AndHowInit {
@Override
public AndHowConfiguration getConfiguration() {
AndHowConfiguration config = AndHow.findConfig();
List<Class<? extends StandardLoader>> sll = config.getDefaultLoaderList();
...do some rearranging of the list...
config.setStandardLoaders(sll) ...and go on to call other methods on config...
}
}
Note: AndHow version up to and including 0.4.1 had this method as a static method.
getDefaultLoaderList in interface AndHowConfiguration<C extends BaseConfig<C>>public LoaderEnvironment getLoaderEnvironment()
Collections like environmental vars and system props, which may have been empty
because they were not explicitly set, will be replaced with the actual env vars or
sys props in the returned immutable version. Thus, the LoaderEnvironment returned
from this method may not match the individual accessor methods of the
LoaderEnvironmentBuilder.
getLoaderEnvironment in interface AndHowConfiguration<C extends BaseConfig<C>>Copyright © 2022. All rights reserved.