|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectru.sstu.properties.core.PropertyHelper
public class PropertyHelper
PropertyManager class provides mechanisms for properties
loading into settings objects and vice versa.
The subclass of AbstractSettings should contain fields
marked with Property annotation.
| Nested Class Summary | |
|---|---|
static interface |
PropertyHelper.Converter<T>
Converter interface represents converter from String
to given type T. |
| Constructor Summary | |
|---|---|
PropertyHelper()
|
|
| Method Summary | ||
|---|---|---|
static
|
load(T object,
InputStream input)
Loads given properties into settings object. |
|
static
|
load(T object,
Map<Object,Object> properties)
Loads given properties into settings object. |
|
protected void |
setConverter(Class<?> type,
PropertyHelper.Converter<?> converter)
Adds converter for given class. |
|
static Map<Object,Object> |
toProperties(Object object)
Provides properties as Map object for given settings object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PropertyHelper()
| Method Detail |
|---|
public static <T> T load(T object,
InputStream input)
throws PropertyException
T - type of settings holderobject - settings holderinput - input stream
PropertyException - if properties cannot be loaded
public static <T> T load(T object,
Map<Object,Object> properties)
throws PropertyException
T - type of settings holderobject - settings holderproperties - properties
PropertyException - if properties cannot be loaded
public static Map<Object,Object> toProperties(Object object)
throws PropertyException
Map object for given settings object.
object - settings holder
PropertyException - if properties cannot be generated
protected void setConverter(Class<?> type,
PropertyHelper.Converter<?> converter)
type - classconverter - converter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||