org.ujoframework.implementation.field
Class FieldProperty<UJO extends Ujo,VALUE>

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

public class FieldProperty<UJO extends Ujo,VALUE>
extends Property<UJO,VALUE>
implements ValueAgent<UJO,VALUE>

A Field property implementation.

Since:
ujo-tool
Author:
Pavel Ponec
See Also:
FieldProperty

Constructor Summary
FieldProperty(java.lang.String name, java.lang.Class<VALUE> type, int index, ValueAgent<UJO,VALUE> agent)
          Constructor
FieldProperty(java.lang.String name, VALUE defaultValue, int index, ValueAgent<UJO,VALUE> agent)
          Constructor with a default value
 
Method Summary
 VALUE readValue(UJO ujo)
          WARNING: There is recommended to call the method from the method Ujo.readProperty(...)
 void writeValue(UJO ujo, VALUE 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, 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

FieldProperty

public FieldProperty(java.lang.String name,
                     java.lang.Class<VALUE> type,
                     int index,
                     ValueAgent<UJO,VALUE> agent)
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.

FieldProperty

public FieldProperty(java.lang.String name,
                     VALUE defaultValue,
                     int index,
                     ValueAgent<UJO,VALUE> agent)
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).
Method Detail

writeValue

public void writeValue(UJO ujo,
                       VALUE 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<UJO extends Ujo,VALUE>
Throws:
java.lang.IllegalArgumentException

readValue

public VALUE readValue(UJO ujo)
                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<UJO extends Ujo,VALUE>
Throws:
java.lang.IllegalArgumentException


Copyright © 2010. All Rights Reserved.