public class StdFixedValueLoader extends FixedValueLoader implements StandardLoader
AndHowInit interface during initialization to
read your configuration. That looks like this:
import org.yarnandtail.andhow.*;
import org.yarnandtail.andhow.property.StrProp;
public class SetFixedValues implements AndHowInit {
@Override public AndHowConfiguration getConfiguration() {
return StdConfig.instance()
.addFixedValue(MY_PROP, 23L); //MY_PROP is some visible property of type Long.
.addFixedValue("A_PROPERTY_NAME", "abc") //A name or alias of a Property works as well
//In both cases, the value (23L or "abc") must be of the same type as the Property or
//an error will be thrown.
}
}
Alternatively you can use AndHow.findConfig() at an application entry
point such as the main method.
StandardLoader's, this loader is intended to be auto-created
by AndHow. The set of standard loaders and their order can bet set
via the AndHowConfiguration.setStandardLoaders() methods.
Other loaders which don't implement the StandardLoader interface can
be inserted into the load order via the
AndHowConfiguration.insertLoaderBefore/After().keyObjectPairValues, unknownPropertyAProblem, values| Constructor and Description |
|---|
StdFixedValueLoader()
There is no reason to use the constructor in production application code
because AndHow creates a single instance on demand at runtime.
|
getLoaderDialect, getLoaderType, getSpecificLoadDescription, isTrimmingRequiredForStringValues, isUnknownPropertyAProblem, load, releaseResources, setKeyObjectPairValues, setPropertyValues, setPropertyValues, setUnknownPropertyAProblemattemptToAdd, attemptToAdd, attemptToAdd, attemptToAddIfNotDuplicate, createValue, findDuplicateProperty, getClassConfig, getConfigSamplePrinter, getInstanceConfig, mapNametoPropertyclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassConfig, getConfigSamplePrinter, getInstanceConfig, getLoaderDialect, getLoaderType, getSpecificLoadDescription, isTrimmingRequiredForStringValues, load, releaseResourcesCopyright © 2021. All rights reserved.