|
||||||||||
| 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.bean.BeanUjo
public abstract class BeanUjo
This abstract class is inteded for an easy implementation of UJO features to a completed JavaBean object.
A "name" of a BeanProperty is a JavaBean property name. By the "name" is deduced a setter and getter method name.
The code syntax is Java 1.5 complied.
Features: an easy support of BEAN objects and the smallest memory footprint per one object.
import org.ujoframework.implementation.BEAN.*; public class Person extends BeanUjo { public static final UjoProperty<Person,String > NAME = newProperty("name" , String.class); public static final UjoProperty<Person,Boolean> MALE = newProperty("male" , Boolean.class); public static final UjoProperty<Person,Date > BIRTH = newProperty("birth", Date.class); // ---- A STANDARD BEAN IMPLEMENTATION ---- private String name; private Boolean male; private Integer age ; public String getName() { return name; } public void setName(String name) { this.name = name; } public Boolean getMale() { return male; } public void setMale(Boolean male) { this.male = male; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } }
BeanProperty| Constructor Summary | |
|---|---|
BeanUjo()
|
|
| Method Summary | ||
|---|---|---|
protected static
|
newListProperty(java.lang.String name,
java.lang.Class<ITEM> type)
A ListProperty Factory for a BeanUjo object. |
|
protected 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, a property type is related from the default value. |
|
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 BeanProperty.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 BeanProperty.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 BeanUjo()
| Method Detail |
|---|
public void writeValue(UjoProperty property,
java.lang.Object value)
property - Property must be a direct type only!BeanProperty.setValue(Ujo,Object)public java.lang.Object readValue(UjoProperty property)
property - Property must be a direct type only!
BeanProperty.getValue(Ujo)
protected static <UJO extends Ujo,VALUE> BeanProperty<UJO,VALUE> newProperty(java.lang.String name,
java.lang.Class<VALUE> type)
protected static <UJO extends Ujo,VALUE> BeanProperty<UJO,VALUE> newProperty(java.lang.String name,
VALUE value)
protected static <UJO extends Ujo,ITEM> BeanPropertyList<UJO,ITEM> newListProperty(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 | |||||||||