|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.topia.persistence.util.BeanPropertyLoador<E>
E - type of bean to bindpublic class BeanPropertyLoador<E>
A implementation fo the Loador contract using
PropertyDescriptor.
| Field Summary | |
|---|---|
protected PropertyDescriptor[] |
descriptors
|
protected Class<E> |
klass
|
protected List<String> |
properties
|
protected static Integer |
ZERO
|
protected static Byte |
ZEROB
|
protected static Double |
ZEROD
|
protected static Float |
ZEROF
|
protected static Long |
ZEROL
|
| Constructor Summary | |
|---|---|
protected |
BeanPropertyLoador(Class<E> klass,
String... properties)
|
| Method Summary | ||
|---|---|---|
protected void |
checkProperties()
|
|
PropertyDescriptor[] |
getDescriptors()
|
|
protected static Object |
getNullValue(Class<?> type)
Deprecated. use TopiaEntityHelper.getNullValue(Class) |
|
List<String> |
getProperties()
|
|
static boolean |
isNullValue(Object value)
Deprecated. use TopiaEntityHelper.isNullValue(Object) |
|
void |
load(E from,
E dst,
boolean tech)
Bind an entity to another. |
|
static
|
newLoador(Class<E> klass,
String... properties)
|
|
Map<String,Object> |
obtainProgperties(E from)
Deprecated. |
|
Map<String,Object> |
obtainProperties(E from)
Obtain from an entity all data to bind to another one according the definition of the loador. |
|
protected void |
setProperty(E dst,
PropertyDescriptor descriptor,
Object value)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final Integer ZERO
protected static final Float ZEROF
protected static final Long ZEROL
protected static final Double ZEROD
protected static final Byte ZEROB
protected List<String> properties
protected transient PropertyDescriptor[] descriptors
protected Class<E> klass
| Constructor Detail |
|---|
protected BeanPropertyLoador(Class<E> klass,
String... properties)
| Method Detail |
|---|
public static <E> BeanPropertyLoador<E> newLoador(Class<E> klass,
String... properties)
public List<String> getProperties()
public PropertyDescriptor[] getDescriptors()
public Map<String,Object> obtainProperties(E from)
LoadorLoador.load(Object, Object, boolean) method.
For example, when an entity has a immutable business key (says with an hibernate naturalId for example),
and that you want to create the data in a db, you must give all the properties at the create time so
this method allow you to do it).
obtainProperties in interface Loador<E>from - the entity to bind
@Deprecated public Map<String,Object> obtainProgperties(E from)
obtainProgperties in interface Loador<E>
public void load(E from,
E dst,
boolean tech)
Loador
load in interface Loador<E>from - the source entitydst - the destination entitytech - a flag to bind or not the technical values of the entity (says TopiaId, TopiaVersion and TopiaCreateDate).
protected void setProperty(E dst,
PropertyDescriptor descriptor,
Object value)
@Deprecated protected static Object getNullValue(Class<?> type)
TopiaEntityHelper.getNullValue(Class)
type - type to test
@Deprecated public static boolean isNullValue(Object value)
TopiaEntityHelper.isNullValue(Object)
value - the value to test
true if value is nullprotected void checkProperties()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||