ref_send API 2.17
defensive programming in Java

org.ref_send.type
Class Typedef

java.lang.Object
  extended by org.ref_send.type.Typedef

public final class Typedef
extends java.lang.Object

Type definition manipulation.


Method Summary
static java.lang.reflect.Type bound(java.lang.reflect.Type parameter, java.lang.reflect.Type declared)
          Determine the upper bound on a type parameter.
static java.lang.Class<?> raw(java.lang.reflect.Type type)
          Determine the corresponding raw type.
static java.lang.reflect.Type value(java.lang.reflect.TypeVariable<?> p, java.lang.reflect.Type a)
          Gets the value of a type variable.
static
<T> java.lang.reflect.TypeVariable<java.lang.Class<T>>
var(java.lang.Class<T> declaration, java.lang.String name)
          Gets the named type variable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

var

public static <T> java.lang.reflect.TypeVariable<java.lang.Class<T>> var(java.lang.Class<T> declaration,
                                                                         java.lang.String name)
Gets the named type variable.

Parameters:
declaration - generic declaration
name - variable name
Returns:
corresponding type variable
Throws:
java.lang.NullPointerException - no matching variable found

value

public static java.lang.reflect.Type value(java.lang.reflect.TypeVariable<?> p,
                                           java.lang.reflect.Type a)
Gets the value of a type variable.

Parameters:
p - type variable
a - instantiated type
Returns:
type argument, or null if p is not from a or one of its super types

raw

public static java.lang.Class<?> raw(java.lang.reflect.Type type)
Determine the corresponding raw type.

Parameters:
type - generic type
Returns:
corresponding raw type

bound

public static java.lang.reflect.Type bound(java.lang.reflect.Type parameter,
                                           java.lang.reflect.Type declared)
Determine the upper bound on a type parameter.

Parameters:
parameter - generic parameter type
declared - generic class type
Returns:
upper bound on the actual type

ref_send API 2.17
defensive programming in Java

Submit a bug or feature, or get help

Copyright 1998-2009 Waterken Inc. under the terms of the MIT X license.