|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.baka.ambient.commons.Binder
public final class Binder
Binds a POJO bean to a view. Currently only public fields are supported - no getters/setters.
Method Summary | ||
---|---|---|
static Map<Integer,String> |
bindBeanMap(Object bean,
Map<String,Object> map,
boolean beanToMap,
boolean validate)
Copies all properties annotated by Bind to a map. |
|
static Map<Integer,String> |
bindBeanToEditor(Object bean,
SharedPreferences.Editor editor,
boolean validate)
Copies all properties annotated by Bind to an editor. |
|
static Map<Integer,String> |
bindBeanView(Object bean,
View parent,
boolean beanToView,
boolean validate)
Copies all properties annotated by Bind to the view. |
|
static
|
copy(T from,
T to)
Copies all bindable properties from given bean to given bean. |
|
static
|
put(String k,
V v,
Class<? extends V> type,
SharedPreferences.Editor editor)
Puts given object into an editor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Map<Integer,String> bindBeanMap(Object bean, Map<String,Object> map, boolean beanToMap, boolean validate)
Bind
to a map.
bean
- the bean to copy from/tomap
- the map to usebeanToMap
- if true
then data from the bean are copied into
the map. If false
then map's data will be
copied into the bean.validate
- if true
then validation constraints are
checked.
public static Map<Integer,String> bindBeanToEditor(Object bean, SharedPreferences.Editor editor, boolean validate)
Bind
to an editor.
bean
- the bean to copy fromeditor
- the map to usevalidate
- if true
then validation constraints are
checked.
public static <V> void put(String k, V v, Class<? extends V> type, SharedPreferences.Editor editor)
V
- the value typek
- key namev
- valuetype
- the value classeditor
- the editor.public static Map<Integer,String> bindBeanView(Object bean, View parent, boolean beanToView, boolean validate)
Bind
to the view.
bean
- the bean to copy from/toparent
- the view to use for performing View lookup.beanToView
- if true
then data from the bean are copied into
the view. If false
then view's data will be
copied into the bean.validate
- if true
then validation constraints are
checked.
public static <T> void copy(T from, T to)
T
- the bean typefrom
- source beanto
- target bean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |