|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ujoframework.extensions.AbstractUjo
org.ujoframework.extensions.AbstractUjoExt<UJO>
org.ujoframework.implementation.map.MapUjoExt<UJO>
public abstract class MapUjoExt<UJO extends MapUjoExt>
This is an Groovy style implementation of a setter and getter methods for an easier access for developpers,
however the methods have got an weaker type control in compare to the MapUjo implementation.
Sample of usage:
public class Person extends MapUjoExt<Person> { public static final UjoProperty<Person, String> NAME = newProperty("Name" , String.class); public static final UjoProperty<Person, Double> CASH = newProperty("Cash" , Double.class); public static final UjoProperty<Person, Person> CHILD = newProperty("Child", Person.class); public void init() { set(NAME, "George"); set(CHILD, new Person()); set(CHILD, NAME, "Jane"); set(CHILD, CASH, 200d); String name = get(CHILD, NAME); double cash = get(CHILD, CASH); } }
Property| Field Summary | |
|---|---|
protected java.util.HashMap<UjoProperty,java.lang.Object> |
data
Object data |
| Constructor Summary | |
|---|---|
|
MapUjoExt()
Constructor |
protected |
MapUjoExt(java.util.HashMap<UjoProperty,java.lang.Object> aData)
Constructor |
| Method Summary | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
protected static
|
newListProperty(java.lang.String name,
java.lang.Class<ITEM> type)
A ListProperty Factory Method assigns a next property index. |
||||||||||||||||||||||||||||
static
|
newProperty(java.lang.String name,
java.lang.Class<VALUE> type)
Returns a new instance of property where the default value is null. |
||||||||||||||||||||||||||||
protected static
|
newProperty(java.lang.String name,
VALUE value)
A Property Factory Method assigns a next property index. |
||||||||||||||||||||||||||||
protected static
|
newPropertyList(java.lang.String name,
java.lang.Class<ITEM> type)
Deprecated. Use newListProperty(...) instead of. |
||||||||||||||||||||||||||||
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 |
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
dataprotected final java.util.HashMap<UjoProperty,java.lang.Object> data
MapUjoExtpublic MapUjoExt()
MapUjoExtprotected MapUjoExt(java.util.HashMap<UjoProperty,java.lang.Object> aData)
writeValuepublic void writeValue(UjoProperty property, java.lang.Object value)
readValuepublic java.lang.Object readValue(UjoProperty property)
newPropertypublic static <UJO extends MapUjoExt,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name, java.lang.Class<VALUE> type)
newPropertyprotected static <UJO extends MapUjoExt,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name, VALUE value)
newListPropertyprotected static <UJO extends MapUjoExt,ITEM> ListProperty<UJO,ITEM> newListProperty(java.lang.String name, java.lang.Class<ITEM> type)
newPropertyListprotected static final <UJO extends MapUjo,ITEM> ListProperty<UJO,ITEM> newPropertyList(java.lang.String name, java.lang.Class<ITEM> type)
Copyright © 2009. All Rights Reserved. | ||||||||||||||||||||||||||