org.wamblee.reflection
Class PropertyAccessor<T>

java.lang.Object
  extended by org.wamblee.reflection.PropertyAccessor<T>
Type Parameters:
T - Type of the property.
All Implemented Interfaces:
Accessor<T>

public class PropertyAccessor<T>
extends Object
implements Accessor<T>

Accessing a property of an object.

Author:
Erik Brakkee

Constructor Summary
PropertyAccessor(Method aGetter, Method aSetter)
          Constructs the accessor.
 
Method Summary
 T get(Object aEntity)
          Gets the value.
 Method getGetter()
           
 Method getSetter()
           
 Class<T> getType()
          Gets the type of the value.
 void set(Object aEntity, T aValue)
          Sets the value.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertyAccessor

public PropertyAccessor(Method aGetter,
                        Method aSetter)
Constructs the accessor.

Parameters:
aGetter - Getter method.
aSetter - Setter method.
Method Detail

get

public T get(Object aEntity)
Description copied from interface: Accessor
Gets the value.

Specified by:
get in interface Accessor<T>
Parameters:
aEntity - Object
Returns:
Value

set

public void set(Object aEntity,
                T aValue)
Description copied from interface: Accessor
Sets the value.

Specified by:
set in interface Accessor<T>
Parameters:
aEntity - Object.
aValue - Value.

getGetter

public Method getGetter()
Returns:
The getter.

getSetter

public Method getSetter()
Returns:
The setter.

toString

public String toString()
Overrides:
toString in class Object

getType

public Class<T> getType()
Description copied from interface: Accessor
Gets the type of the value.

Specified by:
getType in interface Accessor<T>
Returns:


Copyright © 2011. All Rights Reserved.