public class AndHowUtil extends Object
| Constructor and Description |
|---|
AndHowUtil() |
| Modifier and Type | Method and Description |
|---|---|
static StaticPropertyConfigurationMutable |
buildDefinition(List<GroupProxy> groups,
List<Loader> loaders,
NamingStrategy naming,
ProblemList<Problem> problems)
Build a fully populated ConstructionDefinition from the passed Groups,
using the NamingStrategy to generate names for each.
|
static AppFatalException |
buildFatalException(ProblemList<Problem> problems) |
static List<GroupProxy> |
buildGroupProxies(Collection<Class<?>> registeredGroups) |
static GroupProxy |
buildGroupProxy(Class<?> group)
Invokes buildGroupProxy(group, true).
|
static GroupProxy |
buildGroupProxy(Class<?> group,
boolean userGroup)
Wraps a class that contains AndHow Properties in Proxy class for use within AndHow.
|
static boolean |
classExists(String className)
Returns true if the specified class name is on the classpath.
|
static AndHowConfiguration |
findConfiguration(AndHowConfiguration defaultConfig) |
static Method |
findMethod(Class<?> target,
String name,
Class<?>... parameterTypes)
Hunts up the inheritance tree to find the specified method.
|
static Class<?> |
getClassForName(String className)
Loads a class by name with no errors, returning null if the class cannot be found.
|
static Object |
getClassInstanceForName(String className)
Creates a new Object instance from the named class using the default
no-arg constructor.
|
static List<Exporter> |
getExporters(GroupProxy group)
Returns the list of Exporters that are annotated for a BasePropertyGroup.
|
static String |
getFieldName(Class<?> group,
Property<?> property)
Gets the field name for a property in a class, which is just the last
portion of the canonical name.
|
static List<NameAndProperty> |
getProperties(Class<?> group)
Builds a list of all Properties and their field names contained in the
passed class.
|
protected static ProblemList<ConstructionProblem> |
registerGroup(StaticPropertyConfigurationMutable appDef,
GroupProxy group) |
public static StaticPropertyConfigurationMutable buildDefinition(List<GroupProxy> groups, List<Loader> loaders, NamingStrategy naming, ProblemList<Problem> problems)
groups - The PropertyGroups from which to find Properties. May be
null.loaders - The Loaders, which may their own configurable
PropertyGroups.naming - A naming strategy to use when reading the properties during
loadingproblems - If construction problems are found, add to this list.protected static ProblemList<ConstructionProblem> registerGroup(StaticPropertyConfigurationMutable appDef, GroupProxy group)
public static AppFatalException buildFatalException(ProblemList<Problem> problems)
public static List<Exporter> getExporters(GroupProxy group) throws InstantiationException, IllegalAccessException
group - InstantiationExceptionIllegalAccessExceptionpublic static List<NameAndProperty> getProperties(Class<?> group) throws IllegalArgumentException, IllegalAccessException, SecurityException
group - IllegalArgumentExceptionIllegalAccessExceptionSecurityExceptionpublic static GroupProxy buildGroupProxy(Class<?> group) throws IllegalArgumentException, IllegalAccessException, SecurityException
group - IllegalArgumentExceptionIllegalAccessExceptionSecurityExceptionpublic static GroupProxy buildGroupProxy(Class<?> group, boolean userGroup) throws IllegalArgumentException, IllegalAccessException, SecurityException
group - userGroup - If true, this group is a user specified groupIllegalArgumentExceptionIllegalAccessExceptionSecurityExceptionpublic static List<GroupProxy> buildGroupProxies(Collection<Class<?>> registeredGroups) throws AppFatalException
AppFatalExceptionpublic static String getFieldName(Class<?> group, Property<?> property) throws IllegalArgumentException, IllegalAccessException, SecurityException
group - property - IllegalArgumentExceptionIllegalAccessExceptionSecurityExceptionpublic static Method findMethod(Class<?> target, String name, Class<?>... parameterTypes) throws SecurityException
target - The class to start searching fromname - parameterTypes - SecurityExceptionpublic static boolean classExists(String className)
className - public static Class<?> getClassForName(String className)
className - public static Object getClassInstanceForName(String className)
className - public static AndHowConfiguration findConfiguration(AndHowConfiguration defaultConfig) throws AppFatalException
AppFatalExceptionCopyright © 2017. All rights reserved.