org.apache.derby.iapi.services.loader
Class Java5ClassInspector

java.lang.Object
  extended by org.apache.derby.iapi.services.loader.ClassInspector
      extended by org.apache.derby.iapi.services.loader.Java5ClassInspector

public class Java5ClassInspector
extends ClassInspector

A ClassInspector for JVMs which support the language features introduced by Java 5, including generics.


Constructor Summary
Java5ClassInspector(ClassFactory cf)
          DO NOT USE!
 
Method Summary
private  void addResolvedTypes(java.util.HashMap<java.lang.reflect.Type,java.lang.reflect.Type> resolvedTypes, java.lang.reflect.Type genericType)
          Given a generic type, add its parameter types to an evolving map of resolved types.
private  java.lang.Class[] boundType(java.lang.reflect.Type type)
          Get the bounds for a single type variable.
private  java.lang.Class[][] findTypeBounds(java.lang.reflect.ParameterizedType pt)
          Get the type bounds for all of the type variables of the given parameterized type.
 java.lang.Class[] getGenericParameterTypes(java.lang.Class parameterizedType, java.lang.Class implementation)
          Given an implementation of a parameterized interface, return the actual types of the interface type variables.
private  java.util.ArrayList<java.lang.Class<?>> getParameterTypes(java.lang.Class<?> parameterizedType, java.util.HashMap<java.lang.reflect.Type,java.lang.reflect.Type> resolvedTypes)
          Given a map of resolved types, compose them together in order to resolve the actual concrete types that are plugged into the parameterized type.
private  java.lang.Class getRawType(java.lang.reflect.Type bound)
          Get the raw type of a type bound.
private  java.util.HashMap<java.lang.reflect.Type,java.lang.reflect.Type> getResolvedTypes(java.util.ArrayList<java.lang.Class<?>> chain)
          Given an inheritance chain of types, stretching from a superclass down to a terminal concrete class, construct a map of generic types to their resolved types.
 java.lang.Class[][] getTypeBounds(java.lang.Class parameterizedInterface, java.lang.Class implementation)
          Get the bounds for the type variables of a parameterized interface as declared for an implementing class.
private  java.util.ArrayList<java.lang.Class<?>> getTypeChain(java.lang.Class<?> chainEnd, java.lang.Class<?> start)
          Construct an inheritance chain of types stretching from a supertype down to a concrete implementation.
 boolean isVarArgsMethod(java.lang.reflect.Member member)
          Return true if the method or constructor supports varargs.
 
Methods inherited from class org.apache.derby.iapi.services.loader.ClassInspector
accessible, assignableTo, classConvertableFromTo, findPublicConstructor, findPublicField, findPublicMethod, getClass, getDeclaringClass, getParameterTypes, getType, instanceOf, primitiveType, readableClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Java5ClassInspector

public Java5ClassInspector(ClassFactory cf)
DO NOT USE! use the method in ClassFactory.

Method Detail

getTypeBounds

public java.lang.Class[][] getTypeBounds(java.lang.Class parameterizedInterface,
                                         java.lang.Class implementation)
                                  throws StandardException
Get the bounds for the type variables of a parameterized interface as declared for an implementing class. A given set of type bounds could be null if we're confused.

Overrides:
getTypeBounds in class ClassInspector
Throws:
StandardException

isVarArgsMethod

public boolean isVarArgsMethod(java.lang.reflect.Member member)
Description copied from class: ClassInspector
Return true if the method or constructor supports varargs.

Overrides:
isVarArgsMethod in class ClassInspector

getGenericParameterTypes

public java.lang.Class[] getGenericParameterTypes(java.lang.Class parameterizedType,
                                                  java.lang.Class implementation)
                                           throws StandardException
Description copied from class: ClassInspector
Given an implementation of a parameterized interface, return the actual types of the interface type variables. This method raises an exception if the JVM does not support generics. May return null or an array of nulls if type resolution fails.

Overrides:
getGenericParameterTypes in class ClassInspector
Throws:
StandardException

findTypeBounds

private java.lang.Class[][] findTypeBounds(java.lang.reflect.ParameterizedType pt)
Get the type bounds for all of the type variables of the given parameterized type.


boundType

private java.lang.Class[] boundType(java.lang.reflect.Type type)
Get the bounds for a single type variable.


getRawType

private java.lang.Class getRawType(java.lang.reflect.Type bound)
Get the raw type of a type bound.


getTypeChain

private java.util.ArrayList<java.lang.Class<?>> getTypeChain(java.lang.Class<?> chainEnd,
                                                             java.lang.Class<?> start)
Construct an inheritance chain of types stretching from a supertype down to a concrete implementation.


getResolvedTypes

private java.util.HashMap<java.lang.reflect.Type,java.lang.reflect.Type> getResolvedTypes(java.util.ArrayList<java.lang.Class<?>> chain)
Given an inheritance chain of types, stretching from a superclass down to a terminal concrete class, construct a map of generic types to their resolved types.


addResolvedTypes

private void addResolvedTypes(java.util.HashMap<java.lang.reflect.Type,java.lang.reflect.Type> resolvedTypes,
                              java.lang.reflect.Type genericType)
Given a generic type, add its parameter types to an evolving map of resolved types. Some of the resolved types may be generic type variables which will need further resolution from other generic types.


getParameterTypes

private java.util.ArrayList<java.lang.Class<?>> getParameterTypes(java.lang.Class<?> parameterizedType,
                                                                  java.util.HashMap<java.lang.reflect.Type,java.lang.reflect.Type> resolvedTypes)
Given a map of resolved types, compose them together in order to resolve the actual concrete types that are plugged into the parameterized type.


Built on Wed 2013-06-12 15:21:56+0000, from revision ???

Apache Derby V10.10 Internals - Copyright © 2004,2013 The Apache Software Foundation. All Rights Reserved.