public class ConfigurationDataBuilder extends Object
Property fields
from SettingsHolder implementations via reflection.
Properties must be declared as public static fields or they are ignored.
| Modifier and Type | Field and Description |
|---|---|
protected CommentsConfiguration |
commentsConfiguration |
protected PropertyListBuilder |
propertyListBuilder |
| Modifier | Constructor and Description |
|---|---|
protected |
ConfigurationDataBuilder() |
| Modifier and Type | Method and Description |
|---|---|
protected ConfigurationData |
collectData(Iterable<Class<? extends SettingsHolder>> classes)
Collects property data and comment info from the given class and creates a configuration data
instance with it.
|
protected void |
collectProperties(Class<?> clazz)
Registers all property fields of the given class to this instance's property list builder.
|
protected void |
collectSectionComments(Class<? extends SettingsHolder> clazz) |
static ConfigurationData |
createConfiguration(Class<? extends SettingsHolder>... classes)
Collects all properties and comment data from the provided classes.
|
static ConfigurationData |
createConfiguration(Iterable<Class<? extends SettingsHolder>> classes)
Collects all properties and comment data from the provided classes.
|
static ConfigurationData |
createConfiguration(List<? extends Property<?>> properties) |
static ConfigurationData |
createConfiguration(List<? extends Property<?>> properties,
CommentsConfiguration commentsConfiguration) |
protected <T extends SettingsHolder> |
createSettingsHolderInstance(Class<T> clazz)
Creates an instance of the given settings holder class.
|
protected Property<?> |
getPropertyField(Field field)
Returns the given field's value if it is a static
Property. |
protected void |
setCommentForPropertyField(Field field,
String path) |
protected PropertyListBuilder propertyListBuilder
protected CommentsConfiguration commentsConfiguration
@SafeVarargs public static ConfigurationData createConfiguration(Class<? extends SettingsHolder>... classes)
classes - the classes to scan for their property datapublic static ConfigurationData createConfiguration(Iterable<Class<? extends SettingsHolder>> classes)
classes - the classes to scan for their property datapublic static ConfigurationData createConfiguration(List<? extends Property<?>> properties)
public static ConfigurationData createConfiguration(List<? extends Property<?>> properties, CommentsConfiguration commentsConfiguration)
protected ConfigurationData collectData(Iterable<Class<? extends SettingsHolder>> classes)
classes - the classes to processprotected void collectProperties(Class<?> clazz)
clazz - the class to process@Nullable protected Property<?> getPropertyField(Field field)
Property.field - the field's value to returnprotected void collectSectionComments(Class<? extends SettingsHolder> clazz)
protected <T extends SettingsHolder> T createSettingsHolderInstance(Class<T> clazz)
T - the class typeclazz - the class to instantiateCopyright © 2016–2018 The AuthMe Team. All rights reserved.