|
||||||||||
| 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.array.ArrayUjo
public abstract class ArrayUjo
This is a very fast abstract implementation of Ujo.
For implementation define only a "public static final UjoProperty" constants and a "readPropertyCount()" method in a child class.
The code syntax is Java 1.5 complied.
All properties must be objects (no primitive types) in the current version of UJO Framework.
Features: very good performance, an order of properties from "readProperties()" method is guaranteed and independed on a Java implementation.
import org.ujoframework.implementation.array.*; public class Person extends ArrayUjo { protected static int propertyCount = ArrayUjo.propertyCount; public static final UjoProperty<Person,String > NAME = newProperty("name" , String.class , propertyCount++); public static final UjoProperty<Person,Boolean> MALE = newProperty("male" , Boolean.class, propertyCount++); public static final UjoProperty<Person,Date > BIRTH = newProperty("birth", Date.class , propertyCount++); @Override public int readPropertyCount() { return propertyCount; } }
Property| Field Summary | |
|---|---|
protected java.lang.Object[] |
data
Object data |
protected static int |
propertyCount
An Incrementator. |
| Constructor Summary | |
|---|---|
ArrayUjo()
Constructor |
|
ArrayUjo(java.lang.Object[] data)
|
|
| 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. |
||||||||||||||||||||||||
protected static
|
newPropertyList_(java.lang.String name,
java.lang.Class<ITEM> type,
int index)
Deprecated. Use method newListProperty |
||||||||||||||||||||||||
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
ArrayUjopublic ArrayUjo()
ArrayUjopublic ArrayUjo(java.lang.Object[] data)
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 ArrayUjo,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name, java.lang.Class<VALUE> type, int index)
newPropertyprotected static <UJO extends ArrayUjo,VALUE> Property<UJO,VALUE> newProperty(java.lang.String name, VALUE value, int index)
newListPropertyprotected static <UJO extends ArrayUjo,ITEM> ListProperty<UJO,ITEM> newListProperty(java.lang.String name, java.lang.Class<ITEM> type, int index)
newPropertyList_protected static <UJO extends ArrayUjo,ITEM> ListProperty<UJO,ITEM> newPropertyList_(java.lang.String name, java.lang.Class<ITEM> type, int index)
Copyright © 2009. All Rights Reserved. | ||||||||||||||||||||||