|
||||||||||
| 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,
Serialized Form| 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 Property.getValue(org.ujoframework.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 Property.setValue(org.ujoframework.Ujo, java.lang.Object)
to an external access for a better type safe. |
|
| Methods inherited from class org.ujoframework.extensions.AbstractUjoExt |
|---|
add, clone, copyTo, copyTo, createPropertyList, equals, findProperty, get, get, get, get, getItemCount, getText, isDefault, list, remove, remove, set, set, set, set, setText |
| Methods inherited from class org.ujoframework.extensions.AbstractUjo |
|---|
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 |
| Methods inherited from interface org.ujoframework.Ujo |
|---|
readAuthorization, readProperties |
| Field Detail |
|---|
protected final java.util.HashMap<UjoProperty,java.lang.Object> data
| Constructor Detail |
|---|
public MapUjoExt()
protected MapUjoExt(java.util.HashMap<UjoProperty,java.lang.Object> aData)
| Method Detail |
|---|
public void writeValue(UjoProperty property,
java.lang.Object value)
Property.setValue(org.ujoframework.Ujo, java.lang.Object)
to an external access for a better type safe.
The method have got a strategy place for an implementation of several listeners and validators.
writeValue in interface Ujoproperty - Property must be a direct type only!Property.setValue(Ujo,Object)public java.lang.Object readValue(UjoProperty property)
Property.getValue(org.ujoframework.Ujo)
to an external access for a better type safe.
The method have got a strategy place for an implementation of several listeners and convertors.
readValue in interface Ujoproperty - Property must be a direct type only!
Property.getValue(Ujo)
public static <UJO extends MapUjoExt,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name,
java.lang.Class<VALUE> type)
protected static <UJO extends MapUjoExt,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name,
VALUE value)
protected static <UJO extends MapUjoExt,ITEM> ListProperty<UJO,ITEM> newListProperty(java.lang.String name,
java.lang.Class<ITEM> type)
protected static final <UJO extends MapUjo,ITEM> ListProperty<UJO,ITEM> newPropertyList(java.lang.String name,
java.lang.Class<ITEM> type)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||