org.ujoframework.implementation.bean
Class BeanProperty<UJO extends Ujo,VALUE>

java.lang.Object
  extended by org.ujoframework.extensions.Property<UJO,VALUE>
      extended by org.ujoframework.implementation.bean.BeanProperty<UJO,VALUE>
All Implemented Interfaces:
java.lang.CharSequence, ValueAgent<java.lang.Object,java.lang.Object>, UjoProperty<UJO,VALUE>

public class BeanProperty<UJO extends Ujo,VALUE>
extends Property<UJO,VALUE>
implements ValueAgent<java.lang.Object,java.lang.Object>

A Map property implementation.

Author:
Pavel Ponec
See Also:
BeanProperty

Constructor Summary
BeanProperty(java.lang.String name, java.lang.Class<VALUE> type, int index)
          Constructor
BeanProperty(java.lang.String name, VALUE defaultValue, int index)
          Constructor with a default value
 
Method Summary
static
<UJO extends Ujo,VALUE>
BeanProperty<UJO,VALUE>
newInstance(java.lang.String name, java.lang.Class<VALUE> type, int index)
          Returns a new instance of property where the default value is null.
static
<UJO extends Ujo,VALUE>
BeanProperty<UJO,VALUE>
newInstance(java.lang.String name, VALUE value, int index)
          A Property Factory creates new property and assigns a next property index.
 java.lang.Object readValue(java.lang.Object bean)
          WARNING: There is recommended to call the method from the method Ujo.readProperty(...)
 void writeValue(java.lang.Object bean, java.lang.Object value)
          WARNING: There is recommended to call the method from the method Ujo.writeProperty(...) only.
 
Methods inherited from class org.ujoframework.extensions.Property
_nextSequence, add, compareTo, copy, descending, equals, getDefault, getIndex, getName, getType, getValue, charAt, checkAttribs, init, isAscending, isDefault, isDirect, isTypeOf, length, newInstance, newInstance, newInstance, newInstance, newInstance, of, setValue, setValueFromDefault, subSequence, toString, writeDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanProperty

public BeanProperty(java.lang.String name,
                    java.lang.Class<VALUE> type,
                    int index)
Constructor

Parameters:
name - The parameter MUST be a JavaBeans property name. The name will be used for building a Java reflection method name in a time of the first call.
type - Type of a JavaBeans setter input method or getter output method.
index - An order of property.

BeanProperty

public BeanProperty(java.lang.String name,
                    VALUE defaultValue,
                    int index)
Constructor with a default value

Parameters:
name - The parameter MUST be a JavaBeans property name. The name will be used for building a Java reflection method name in a time of the first call.
defaultValue - The value must be type of VALUE exactly (no child).
index - An order of property.
Method Detail

writeValue

public void writeValue(java.lang.Object bean,
                       java.lang.Object value)
                throws java.lang.IllegalArgumentException
WARNING: There is recommended to call the method from the method Ujo.writeProperty(...) only.
A direct call can bypass a important actions implemented in the writeProperty(method).

Specified by:
writeValue in interface ValueAgent<java.lang.Object,java.lang.Object>
Throws:
java.lang.IllegalArgumentException

readValue

public java.lang.Object readValue(java.lang.Object bean)
                           throws java.lang.IllegalArgumentException
WARNING: There is recommended to call the method from the method Ujo.readProperty(...) only.
A direct call can bypass a important actions implemented in the readProperty(method).

Specified by:
readValue in interface ValueAgent<java.lang.Object,java.lang.Object>
Throws:
java.lang.IllegalArgumentException

newInstance

public static <UJO extends Ujo,VALUE> BeanProperty<UJO,VALUE> newInstance(java.lang.String name,
                                                                          java.lang.Class<VALUE> type,
                                                                          int index)
Returns a new instance of property where the default value is null. Method assigns a next property index.


newInstance

public static <UJO extends Ujo,VALUE> BeanProperty<UJO,VALUE> newInstance(java.lang.String name,
                                                                          VALUE value,
                                                                          int index)
A Property Factory creates new property and assigns a next property index.



Copyright © 2010. All Rights Reserved.