de.mguennewig.pobjtool
Class TypeClassHandler

java.lang.Object
  extended by de.mguennewig.pobjtool.TypeClassHandler
All Implemented Interfaces:
java.lang.reflect.InvocationHandler

public final class TypeClassHandler
extends java.lang.Object
implements java.lang.reflect.InvocationHandler

An invocation handler that calls an instance of the type class of a given type instance.

Author:
Michael Günnewig

Constructor Summary
TypeClassHandler(Type t)
          Creates a new invocation handler that calls an instance of the type class that the given type specifies.
 
Method Summary
 Type getType()
           
 java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeClassHandler

public TypeClassHandler(Type t)
                 throws java.lang.ClassNotFoundException
Creates a new invocation handler that calls an instance of the type class that the given type specifies.

Throws:
java.lang.ClassNotFoundException - if the type class of the given type can not be found.
java.lang.IllegalArgumentException - if the type class can not be instantiated due to different reasons.
Method Detail

getType

public Type getType()

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