Errai 3.0.1-SNAPSHOT

org.jboss.errai.jpa.sync.server
Class JavaReflectionAttributeAccessor

java.lang.Object
  extended by org.jboss.errai.jpa.sync.server.JavaReflectionAttributeAccessor
All Implemented Interfaces:
JpaAttributeAccessor

public class JavaReflectionAttributeAccessor
extends Object
implements JpaAttributeAccessor

An implementation of JpaAttributeAccessor that works on the server by reflectively reading fields and/or invoking getter methods.

Author:
Jonathan Fuerth

Constructor Summary
JavaReflectionAttributeAccessor()
           
 
Method Summary
<X,Y> Y
get(javax.persistence.metamodel.Attribute<X,Y> attr, X entity)
          Retrieves the current value of the given attribute from the given entity.
<X,Y> void
set(javax.persistence.metamodel.Attribute<X,Y> attr, X entity, Y value)
          Sets the current value of the given attribute on the given entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaReflectionAttributeAccessor

public JavaReflectionAttributeAccessor()
Method Detail

get

public <X,Y> Y get(javax.persistence.metamodel.Attribute<X,Y> attr,
                   X entity)
Description copied from interface: JpaAttributeAccessor
Retrieves the current value of the given attribute from the given entity.

Specified by:
get in interface JpaAttributeAccessor
Parameters:
attr - The attribute to retrieve. Must not be null.
entity - the entity instance to read the attribute value from. Must not be null.
Returns:
The value of the given attribute. May be null.

set

public <X,Y> void set(javax.persistence.metamodel.Attribute<X,Y> attr,
                      X entity,
                      Y value)
Description copied from interface: JpaAttributeAccessor
Sets the current value of the given attribute on the given entity.

Specified by:
set in interface JpaAttributeAccessor
Parameters:
attr - The attribute to retrieve. Must not be null.
entity - the entity instance to read the attribute value from. Must not be null.
value - The new value for the attribute. May be null.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.