Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.

fj
Class Class<T>

java.lang.Object
  extended by fj.Class<T>

public final class Class<T>
extends Object

A wrapper for a Class that provides additional methods.


Method Summary
 Class<T> clas()
          Returns the underlying class.
static
<T> Class<T>
clas(Class<T> c)
          Constructs a class from the given argument.
 Tree<Type> classParameters()
          Provides this class's type parameter information as a Tree of the type expression.
 List<Class<? super T>> inheritance()
          Returns the inheritance hierarchy of this class.
 List<Tree<Type>> interfaceParameters()
          Provides this class's interface type parameter information as a list of trees.
 Tree<Type> superclassParameters()
          Provides this class's superclass type parameter information as a Tree of the type expression.
static Tree<Type> typeParameterTree(Type t)
          Provides type parameter information as a Tree of the type expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

inheritance

public List<Class<? super T>> inheritance()
Returns the inheritance hierarchy of this class.

Returns:
The inheritance hierarchy of this class.

classParameters

public Tree<Type> classParameters()
Provides this class's type parameter information as a Tree of the type expression. Only descends into Parameterized classes. Non-abstract classes, or classes that don't implement an interface, are treated as raw types. Arrays, Type Variables, and Wildcards are treated as opaque Types.

Returns:
The rose tree representing the type expression for this class.

superclassParameters

public Tree<Type> superclassParameters()
Provides this class's superclass type parameter information as a Tree of the type expression. Only descends into Parameterized classes. Non-abstract classes, or classes that don't implement an interface, are treated as raw types. Arrays, Type Variables, and Wildcards are treated as opaque Types.

Returns:
The Tree representing the type expression for this class's superclass.

interfaceParameters

public List<Tree<Type>> interfaceParameters()
Provides this class's interface type parameter information as a list of trees.

Returns:
A list of trees representing the type expressions for this class's interfaces.

typeParameterTree

public static Tree<Type> typeParameterTree(Type t)
Provides type parameter information as a Tree of the type expression. Only descends into Parameterized classes. Non-abstract classes, or classes that don't implement an interface, are treated as raw types. Arrays, Type Variables, and Wildcards are treated as opaque Types.

Parameters:
t - The type (class) for which to get the generic type information.
Returns:
Type parameter information as a rose tree of the type expression.

clas

public Class<T> clas()
Returns the underlying class.

Returns:
The underlying class.

clas

public static <T> Class<T> clas(Class<T> c)
Constructs a class from the given argument.

Parameters:
c - The argument to construct this class with.
Returns:
A class from the given argument.

Copyright 2008 - 2009 Tony Morris, Runar Bjarnason, Tom Adams, Brad Clow, Ricky Clarkson, Nick Partridge, Jason Zaugg

This software is released under an open source BSD licence.