public class AndHow extends Object implements StaticPropertyConfiguration, ValidatedValues
AndHow.findConfig().setCmdLineArgs(myCmdLineArgs).build();
findConfig() finds the AndHowConfiguration that
would be used if AndHow.instance() was called. build()
then causes the AndHow instance to be built with that modified configuration.
The code above (or any method of AndHow initiation) can only be executed once
during the life of the application.| Modifier and Type | Field and Description |
|---|---|
static String |
ANDHOW_INLINE_NAME |
static String |
ANDHOW_NAME |
static String |
ANDHOW_TAG_LINE |
static String |
ANDHOW_URL |
| Modifier and Type | Method and Description |
|---|---|
static AndHowConfiguration<? extends AndHowConfiguration> |
findConfig()
Finds and creates a new instance of the
AndHowConfiguration
that would be used if AndHow.instance() was called. |
List<EffectiveName> |
getAliases(Property<?> property)
Returns all aliases (in and out) for a property.
|
String |
getCanonicalName(Property<?> prop)
Returns the canonical name of a registered property.
|
<T> T |
getExplicitValue(Property<T> prop)
The value found and loaded for this value by a Loader.
|
GroupProxy |
getGroupForProperty(Property<?> prop)
Finds the Group containing the specified Property.
|
NamingStrategy |
getNamingStrategy()
Defines how names are created for Properties.
|
<T> T |
getValue(Property<T> prop)
The effective value, similar to Property.getValue, but specifically for
the context of this ValueMap.
|
static AndHow |
instance()
Returns the current AndHow instance.
|
static AndHow |
instance(AndHowConfiguration config)
Builds a new AndHow instance using the specified configuration ONLY IF
there is no existing AndHow instance.
|
boolean |
isExplicitlySet(Property<?> prop)
Returns true if the Property's value was explicitly set to a non-null value
via one of the loaders.
|
static boolean |
isInitialize()
Determine if AndHow is initialized or not w/out forcing AndHow to load.
|
public static final String ANDHOW_INLINE_NAME
public static final String ANDHOW_NAME
public static final String ANDHOW_URL
public static final String ANDHOW_TAG_LINE
public static AndHowConfiguration<? extends AndHowConfiguration> findConfig()
AndHowConfiguration
that would be used if AndHow.instance() was called.
Note: If AndHow.instance() is later called, a new
AndHowConfiguration will be returned, not this same instance.
This method provides a way to add command line parameters or fixed values
to the existing configuration and then immediately initiate AndHow.
Example usage:
AndHow.findConfig().setCmdLineArgs(myCmdLineArgs).build();
The call to build() at the end of that command string is
just a convenience method to call AndHow.instance(thisConfiguration);public static AndHow instance() throws AppFatalException
AppFatalExceptionpublic static AndHow instance(AndHowConfiguration config) throws AppFatalException
config - AppFatalExceptionpublic static boolean isInitialize()
public boolean isExplicitlySet(Property<?> prop)
ValidatedValuesisExplicitlySet in interface ValidatedValuesprop - The property to checkpublic <T> T getExplicitValue(Property<T> prop)
ValidatedValuesgetExplicitValue in interface ValidatedValuesT - The return type of the Property.prop - The property to get the value forpublic <T> T getValue(Property<T> prop)
ValidatedValuesgetValue in interface ValidatedValuesT - The return type of the Property.prop - The property to get the value for.public List<EffectiveName> getAliases(Property<?> property)
StaticPropertyConfigurationgetAliases in interface StaticPropertyConfigurationproperty - The property to fetch naming information forpublic String getCanonicalName(Property<?> prop)
StaticPropertyConfigurationgetCanonicalName in interface StaticPropertyConfigurationprop - The property to get the canonical name forpublic GroupProxy getGroupForProperty(Property<?> prop)
StaticPropertyConfigurationgetGroupForProperty in interface StaticPropertyConfigurationprop - The property to get the PropertyGroup forpublic NamingStrategy getNamingStrategy()
StaticPropertyConfigurationgetNamingStrategy in interface StaticPropertyConfigurationCopyright © 2017. All rights reserved.