intarsys runtime library

de.intarsys.tools.reflect
Class ReflectionRelationHandler

java.lang.Object
  extended by de.intarsys.tools.reflect.RelationHandlerAdapter
      extended by de.intarsys.tools.reflect.ReflectionRelationHandler
All Implemented Interfaces:
IRelationHandler

public class ReflectionRelationHandler
extends RelationHandlerAdapter

The relation is implemented using plain JDK reflection.


Constructor Summary
ReflectionRelationHandler(Method getter, Method inserter, Method remover)
           
 
Method Summary
 Object[] get(Object owner)
          The objects associated with owner.
 Object insert(Object owner, Object value)
          Add a new object to the association in owner.
 Object remove(Object owner, Object value)
          Remove an object from the association in owner.
 Object update(Object owner, Object value, Object newValue)
          Update value in the association for owner to newValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflectionRelationHandler

public ReflectionRelationHandler(Method getter,
                                 Method inserter,
                                 Method remover)
Method Detail

get

public Object[] get(Object owner)
Description copied from interface: IRelationHandler
The objects associated with owner.

Specified by:
get in interface IRelationHandler
Overrides:
get in class RelationHandlerAdapter
Returns:
The objects associated with owner.

insert

public Object insert(Object owner,
                     Object value)
Description copied from interface: IRelationHandler
Add a new object to the association in owner.

Specified by:
insert in interface IRelationHandler
Overrides:
insert in class RelationHandlerAdapter
Returns:
The object inserted

remove

public Object remove(Object owner,
                     Object value)
Description copied from interface: IRelationHandler
Remove an object from the association in owner.

Specified by:
remove in interface IRelationHandler
Overrides:
remove in class RelationHandlerAdapter
Returns:
The object removed

update

public Object update(Object owner,
                     Object value,
                     Object newValue)
Description copied from interface: IRelationHandler
Update value in the association for owner to newValue

Specified by:
update in interface IRelationHandler
Overrides:
update in class RelationHandlerAdapter
Returns:
The newly associated object

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.