net.sf.morph.wrap.support
Class DefaultWrapperInvocationHandler

java.lang.Object
  extended by net.sf.morph.wrap.support.DefaultWrapperInvocationHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler, WrapperInvocationHandler

public class DefaultWrapperInvocationHandler
extends java.lang.Object
implements WrapperInvocationHandler

Default WrapperInvocationHandler implementation.

Since:
Jan 16, 2005
Author:
Matt Sgarlata

Constructor Summary
DefaultWrapperInvocationHandler(java.lang.Object wrapped)
          Create a new DefaultWrapperInvocationHandler.
DefaultWrapperInvocationHandler(java.lang.Object wrapped, Reflector reflector)
          Create a new DefaultWrapperInvocationHandler.
 
Method Summary
protected  BidirectionalMap getBiDirectionalReflectorWrapperMap()
          Get the bidirectional reflector map.
 java.lang.Class[] getInterfaces(java.lang.Object object)
          
 Reflector getReflector()
          Get the reflector.
 java.util.Map getReflectorWrapperMap()
          Get the reflectorWrapperMap.
 java.lang.Object getWrapped()
          Get the wrapped object.
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
          
 void setReflector(Reflector reflector)
          Set the reflector.
 void setReflectorWrapperMap(java.util.Map reflectorWrapperMap)
          Set the reflectorWrapperMap.
 void setWrapped(java.lang.Object wrapped)
          Set the wrapped object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultWrapperInvocationHandler

public DefaultWrapperInvocationHandler(java.lang.Object wrapped)
Create a new DefaultWrapperInvocationHandler.

Parameters:
wrapped - object

DefaultWrapperInvocationHandler

public DefaultWrapperInvocationHandler(java.lang.Object wrapped,
                                       Reflector reflector)
Create a new DefaultWrapperInvocationHandler.

Parameters:
wrapped - object
reflector - to use
Method Detail

invoke

public java.lang.Object invoke(java.lang.Object proxy,
                               java.lang.reflect.Method method,
                               java.lang.Object[] args)
                        throws java.lang.Throwable

Specified by:
invoke in interface java.lang.reflect.InvocationHandler
Throws:
java.lang.Throwable

getInterfaces

public java.lang.Class[] getInterfaces(java.lang.Object object)

Specified by:
getInterfaces in interface WrapperInvocationHandler

getBiDirectionalReflectorWrapperMap

protected BidirectionalMap getBiDirectionalReflectorWrapperMap()
Get the bidirectional reflector map.

Returns:
BidirectionalMap

getReflectorWrapperMap

public java.util.Map getReflectorWrapperMap()
Get the reflectorWrapperMap.

Returns:
Map

setReflectorWrapperMap

public void setReflectorWrapperMap(java.util.Map reflectorWrapperMap)
Set the reflectorWrapperMap.

Parameters:
reflectorWrapperMap - to set

getReflector

public Reflector getReflector()
Get the reflector.

Returns:
Reflector

setReflector

public void setReflector(Reflector reflector)
Set the reflector.

Parameters:
reflector - to set

getWrapped

public java.lang.Object getWrapped()
Get the wrapped object.

Returns:
Object

setWrapped

public void setWrapped(java.lang.Object wrapped)
Set the wrapped object.

Parameters:
wrapped - object to set


Copyright © 2004-2008.