public interface Factory
Config
instances.Modifier and Type | Method | Description |
---|---|---|
String |
clearProperty(String key) |
Clears the value for the property having the given key.
|
<T extends Config> |
create(Class<? extends T> clazz,
Map<?,?>... imports) |
Creates a
Config instance from the specified interface |
Properties |
getProperties() |
Those properties will be used to expand variables specified in the `@Source` annotation, or by the ConfigFactory
to configure its own behavior.
|
String |
getProperty(String key) |
Returns the value for a given property.
|
void |
registerLoader(Loader loader) |
Registers a loader to enables additional file formats.
|
void |
removeTypeConverter(Class<?> type) |
Removes a converter for the given type.
|
void |
setProperties(Properties properties) |
Those properties will be used to expand variables specified in the `@Source` annotation, or by the ConfigFactory
to configure its own behavior.
|
String |
setProperty(String key,
String value) |
Set a property in the ConfigFactory.
|
void |
setTypeConverter(Class<?> type,
Class<? extends Converter<?>> converter) |
Sets a converter for the given type.
|
<T extends Config> T create(Class<? extends T> clazz, Map<?,?>... imports)
Config
instance from the specified interfaceT
- type of the interface.clazz
- the interface extending from Config
that you want to instantiate.imports
- additional variables to be used to resolve the properties.String getProperty(String key)
key
- the key for the propertynull
if the property is not set.String setProperty(String key, String value)
key
- the key for the property.value
- the value for the property.String clearProperty(String key)
key
- the key for the property to remove.null
if the property was not set.Properties getProperties()
void setProperties(Properties properties)
properties
- the properties to set in the config Factory.void registerLoader(Loader loader)
loader
- the loader to register.NullPointerException
- if specified loader is null
.void setTypeConverter(Class<?> type, Class<? extends Converter<?>> converter)
Config.ConverterClass
annotations.type
- the type for which to set a converter.converter
- the converter class to use for the specified type.void removeTypeConverter(Class<?> type)
type
- the type for which to remove the converter.Copyright © 2012–2020 Luigi R. Viggiano. All rights reserved.