org.ujoframework.core
Class BeanManager<UJO,VALUE>

java.lang.Object
  extended by org.ujoframework.core.BeanManager<UJO,VALUE>

public class BeanManager<UJO,VALUE>
extends java.lang.Object

Manager of BeanUjo

Author:
Pavel Ponec

Constructor Summary
BeanManager(UjoProperty property)
           
 
Method Summary
static
<UJO,VALUE>
BeanManager<UJO,VALUE>
getInstance(UjoProperty property)
          Create new instance of BeanManager
 java.lang.reflect.Method getMethod(UJO ujo, boolean set)
          Get or create a setter or getter.
protected  java.lang.String getMethodName(boolean set)
          Returns a method name by a name
protected  java.lang.Class getPrimitive(java.lang.Class objClass)
          Returns a primitive type if can or a null value.
 java.lang.Object readValue(UJO bean)
          WARNING: There is recommended to call the method from the method Ujo.readProperty(...)
 java.lang.String toString()
           
 void writeValue(UJO bean, VALUE value)
          WARNING: There is recommended to call the method from the method Ujo.writeProperty(...) only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BeanManager

public BeanManager(UjoProperty property)
Method Detail

writeValue

public void writeValue(UJO bean,
                       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).

Throws:
java.lang.IllegalArgumentException

readValue

public java.lang.Object readValue(UJO 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).

Throws:
java.lang.IllegalArgumentException

getMethod

public java.lang.reflect.Method getMethod(UJO ujo,
                                          boolean set)
                                   throws java.lang.IllegalArgumentException
Get or create a setter or getter.

Parameters:
ujo - UJO object.
set - The result method can be a setter (TRUE) or a getter (FALSE).
Throws:
java.lang.IllegalArgumentException - Method can't find usable method.

getPrimitive

protected java.lang.Class getPrimitive(java.lang.Class objClass)
Returns a primitive type if can or a null value.


getMethodName

protected java.lang.String getMethodName(boolean set)
Returns a method name by a name


getInstance

public static <UJO,VALUE> BeanManager<UJO,VALUE> getInstance(UjoProperty property)
Create new instance of BeanManager


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2010. All Rights Reserved.