org.bushe.swing.event.generics
Class TypeReference<T>

java.lang.Object
  extended by org.bushe.swing.event.generics.TypeReference<T>

public abstract class TypeReference<T>
extends java.lang.Object

Courtesy of Neil Gafter's blog. Thanks to Curt Cox for the pointer.


Constructor Summary
protected TypeReference()
           
 
Method Summary
 java.lang.reflect.Type getType()
           
 T newInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeReference

protected TypeReference()
Method Detail

newInstance

public T newInstance()
              throws java.lang.NoSuchMethodException,
                     java.lang.IllegalAccessException,
                     java.lang.reflect.InvocationTargetException,
                     java.lang.InstantiationException
Returns:
a new instance of T using the default, no-arg constructor.
Throws:
java.lang.IllegalAccessException - on security reflection issues
java.lang.NoSuchMethodException - there's not getRawType on the type
java.lang.reflect.InvocationTargetException - if a reflective call causes an exception in the underlying instance
java.lang.InstantiationException - if the instance cannot be instantiated

getType

public java.lang.reflect.Type getType()
Returns:
the referenced type.


Copyright © 2010 Bushe Enterprises, Inc.. All Rights Reserved.