|
||||||||||
| 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.array.ArrayUjoExt<UJO>
public abstract class ArrayUjoExt<UJO extends ArrayUjoExt>
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 ArrayUjoExt<Person> { public static final UjoProperty<Person, String > NAME = newProperty("Name" , String.class, propertyCount++); public static final UjoProperty<Person, Double > CASH = newProperty("Cash" , Double.class, propertyCount++); public static final UjoProperty<Person, Person> CHILD = newProperty("Child", Person.class, propertyCount++); 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.lang.Object[] |
data
Object data |
protected static int |
propertyCount
An Incrementator. |
| Constructor Summary | |
|---|---|
ArrayUjoExt()
Constructor |
|
| Method Summary | |||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
protected java.lang.Object[] |
initData()
The method is called from top constructor. |
||||||||||||||||||||||||||||
protected static
|
newListProperty(java.lang.String name,
java.lang.Class<ITEM> type,
int index)
A ListProperty Factory Method assigns a next property index. |
||||||||||||||||||||||||||||
static
|
newProperty(java.lang.String name,
java.lang.Class<VALUE> type,
int index)
Returns a new instance of property where the default value is null. |
||||||||||||||||||||||||||||
protected static
|
newProperty(java.lang.String name,
VALUE value,
int index)
A Property Factory Method assigns a next property index. |
||||||||||||||||||||||||||||
abstract int |
readPropertyCount()
Return a count of properties. |
||||||||||||||||||||||||||||
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
propertyCountprotected static final int propertyCount
dataprotected java.lang.Object[] data
ArrayUjoExtpublic ArrayUjoExt()
initDataprotected java.lang.Object[] initData()
readPropertyCountpublic abstract int readPropertyCount()
writeValuepublic void writeValue(UjoProperty property, java.lang.Object value)
readValuepublic java.lang.Object readValue(UjoProperty property)
newPropertypublic static <UJO extends ArrayUjoExt,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name, java.lang.Class<VALUE> type, int index)
newPropertyprotected static <UJO extends ArrayUjoExt,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name, VALUE value, int index)
newListPropertyprotected static <UJO extends ArrayUjoExt,ITEM> ListProperty<UJO,ITEM> newListProperty(java.lang.String name, java.lang.Class<ITEM> type, int index)
Copyright © 2009. All Rights Reserved. | ||||||||||||||||||||||||||