org.omnaest.utils.proxy
Class BeanProperty

java.lang.Object
  extended by org.omnaest.utils.proxy.BeanProperty

public class BeanProperty
extends Object

A BeanProperty allows to capture method calls for getter and setter methods on a Java Bean. The captured method calls can then be transformed to BeanPropertyAccessor instances or the property names.

See Also:
newInstanceOfCapturedType(Class), newInstanceOfTransitivlyCapturedType(Class), accessor, name, MethodName, MethodCallCapturer

Nested Class Summary
 class BeanProperty.Accessor
          BeanPropertyAccessorresolver for a Java BeanProperty
 class BeanProperty.Name
          Property BeanProperty.Name resolver for a Java BeanProperty
 
Field Summary
 BeanProperty.Accessor accessor
           
protected  MethodCallCapturer methodCallCapturer
           
 BeanProperty.Name name
           
protected static ThreadLocalCachedElement<BeanProperty> threadLocalCachedElementOfBeanProperty
           
 
Constructor Summary
  BeanProperty()
           
protected BeanProperty(MethodCallCapturer methodCallCapturer)
           
 
Method Summary
static BeanProperty getInstance()
          Returns a ThreadLocal specific instance which will be created at the first time of use with a given Thread.
<E> E
newInstanceOfCapturedType(Class<? extends E> clazz)
          Creates a new stub instance for the given class or interface type for which the method calls will be captured.
<E> E
newInstanceOfTransitivlyCapturedType(Class<? extends E> clazz)
          Creates a new stub instance for the given class or interface type for which the method calls will be captured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

accessor

public final BeanProperty.Accessor accessor

name

public final BeanProperty.Name name

threadLocalCachedElementOfBeanProperty

protected static final ThreadLocalCachedElement<BeanProperty> threadLocalCachedElementOfBeanProperty

methodCallCapturer

protected MethodCallCapturer methodCallCapturer
Constructor Detail

BeanProperty

protected BeanProperty(MethodCallCapturer methodCallCapturer)
Parameters:
methodCallCapturer -
See Also:
BeanProperty

BeanProperty

public BeanProperty()
See Also:
BeanProperty
Method Detail

newInstanceOfCapturedType

public <E> E newInstanceOfCapturedType(Class<? extends E> clazz)
Creates a new stub instance for the given class or interface type for which the method calls will be captured. The capturing is not transitive which means that method calls of nested objects / fields are not captured.

Type Parameters:
E -
Parameters:
clazz -
Returns:
See Also:
newInstanceOfTransitivlyCapturedType(Class), #of(Object)

newInstanceOfTransitivlyCapturedType

public <E> E newInstanceOfTransitivlyCapturedType(Class<? extends E> clazz)
Creates a new stub instance for the given class or interface type for which the method calls will be captured. This stub captures transitive method calls for field objects and further child nodes within the object hierarchy as well.

Type Parameters:
E -
Parameters:
clazz -
Returns:
See Also:
newInstanceOfCapturedType(Class)

getInstance

public static BeanProperty getInstance()
Returns a ThreadLocal specific instance which will be created at the first time of use with a given Thread.

Returns:
BeanProperty


Copyright © 2013. All Rights Reserved.