|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.extensions.AbstractUjo
org.ujoframework.implementation.field.FieldUjo
public abstract class FieldUjo
The abstract Ujo implementation use a direct access to its private object fiels. An performance is similar like a MapUjo implementation however the FieldUjo solution have got smaller memore consumption.
public class Person extends FieldUjo { private Long cash; private List<Person> childs; public static UjoProperty<Person,Long> CASH = newProperty("CASH", Long.class , new ValueAgent<Person,Long>() { public void writeValue(Person ujo, Long value) { ujo.cash = value; } public Long readValue (Person ujo) { return ujo.cash; } }); public static FieldPropertyList<Person,Person> CHILDS = newListProperty("CHILDS", Person.class , new ValueAgent<Person,List<Person>>() { public void writeValue(Person ujo, List<Person> value) { ujo.childs = value; } public List<Person> readValue(Person ujo) { return ujo.childs; } }); }
FieldProperty| Constructor Summary | |
|---|---|
FieldUjo()
|
|
| Method Summary | ||
|---|---|---|
protected static
|
newListProperty(java.lang.String name,
java.lang.Class<ITEM> type,
ValueAgent<UJO,java.util.List<ITEM>> agent)
A ListProperty Factory for a FieldUjo object |
|
protected static
|
newProperty(java.lang.String name,
java.lang.Class<VALUE> type,
ValueAgent<UJO,VALUE> agent)
Returns a new instance of property where the default value is null. |
|
protected static
|
newProperty(java.lang.String name,
VALUE value,
ValueAgent<UJO,VALUE> agent)
A Property Factory creates a new property and assigns a next property index. |
|
java.lang.Object |
readValue(UjoProperty property)
It is a common method for reading all object values, however there is strongly recomended to use a method FieldProperty.getValue(Ujo) to an external access for a better type safe. |
|
void |
writeValue(UjoProperty property,
java.lang.Object value)
It is a common method for writing all object values, however there is strongly recomended to use a method FieldProperty.setValue(Ujo,Object) to an external access for a better type safe. |
|
| Methods inherited from class org.ujoframework.extensions.AbstractUjo |
|---|
clone, equals, init, init, readAuthorization, readProperties, readUjoManager, readValueString, toString, writeValueString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public FieldUjo()
| Method Detail |
|---|
public void writeValue(UjoProperty property,
java.lang.Object value)
property - Property must be a direct type only!FieldProperty.setValue(Ujo,Object)public java.lang.Object readValue(UjoProperty property)
property - Property must be a direct type only!
FieldProperty.getValue(Ujo)
protected static <UJO extends Ujo,VALUE> FieldProperty<UJO,VALUE> newProperty(java.lang.String name,
java.lang.Class<VALUE> type,
ValueAgent<UJO,VALUE> agent)
protected static <UJO extends Ujo,VALUE> FieldProperty<UJO,VALUE> newProperty(java.lang.String name,
VALUE value,
ValueAgent<UJO,VALUE> agent)
protected static <UJO extends Ujo,ITEM> FieldPropertyList<UJO,ITEM> newListProperty(java.lang.String name,
java.lang.Class<ITEM> type,
ValueAgent<UJO,java.util.List<ITEM>> agent)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||