| Modifier and Type | Field and Description |
|---|---|
| private static final String | |
| private final ClassFactory | |
| private static final String[] | |
| private static final String | |
| private static final String[] | |
| private static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the class exists and is accessible, false if notThe name of the class to test for existence className)Does the named class exist, and is it accessible? |
| private void | addResolvedTypes(HashMap<Type, Type> resolvedTypes, Type genericType)
Given a generic type, add its parameter types to an evolving map of resolved types. |
| public boolean | Returns: true if an object of type fromClass can be assigned to an object of type toClass, false if not.The name of the class to be assigned fromClassName, String The name of the class to be assigned to toClassName)Is one named class assignable to another named class or interface? |
| private Class | |
| protected boolean | Returns: true if the conversion is possiblefrom class fromClass, Class<T> to class toClass, boolean mixing object/primitive types for comparison mixTypes)Can we convert a fromClass to toClass. |
| public Member | Returns: A Member representing the matching constructor. Returns null if no such constructor.The class name of the receiver receiverType, String[] An array of class names representing the
parameter types. Pass a zero-element array if
there are no parameters. parmTypes, String[] This is used in the second pass of the two-pass
method resolution algorithm. Use primitive type
if it has one, otherwise use same object type primParmTypes, boolean[] Array of booleans telling whether parameter is a ?. isParam)Find a public constructor that implements a given signature. |
| public Member | Returns: A Member representing the matching field.The class name of the receiver receiverType, String The name of the field fieldName, boolean Find a static field staticField)Find a public field for a class. |
| public Member | Returns: A Member representing the matching method. Returns null if no such method.The class name of the receiver receiverType, String The name of the method methodName, String[] An array of class names representing the
parameter types. Pass a zero-element array if
there are no parameters. Pass a null if it is
okay to match any signature. parmTypes, String[] This is used in the second pass of the two-pass
method resolution algorithm. Use primitive type
if it has one, otherwise use same object type primParmTypes, boolean[] Array of booleans telling whether parameter is a ?. isParam, boolean Find a static method. staticMethod, boolean If true the last parameter may be repeated any number of times (total count must be greater than one).
If false the last parameter is matched as usual. This also requires an exact match on the last parameter type. repeatLastParameter, boolean True if a varargs marker is expected hasVarargs)Find a public method that implements a given signature. |
| private Class | findTypeBounds(ParameterizedType pt)
Get the type bounds for all of the type variables of the given parameterized type. |
| public Class | |
| public String | Returns: A String with the declaring classA Member describing a method method)Get the declaring class for a method. |
| public Class | Returns: the actual types of the interface type variablesA parameterized type parameterizedType, Class<T> An implementation of that type implementation)Given an implementation of a parameterized interface, return the actual types of the interface type variables. |
| public String[] | Returns: A String[] describing the parameters of the methodA Member describing a method method)Get the parameter types for a method described by a Member as a String[]. |
| private ArrayList | getParameterTypes(Class<?> parameterizedType, HashMap<Type, 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 Class | |
| private HashMap | getResolvedTypes(ArrayList<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. |
| public String | Returns: A Java-language-style string describing the return type of the method (for example, it returns "int" instead of "I".A Member representing the method for
which we want the return type. member)Get the Java name of the return type from a Member representing a method or the type of a Member representing a field. |
| public Class | Returns: the bounds on the type variableA generic interface parameterizedInterface, Class<T> An implementation of the interface implementation)Given an implementation of a parameterized interface, return the bounds on the type variables. |
| private ArrayList | getTypeChain(Class<?> chainEnd, Class<?> start)
Construct an inheritance chain of types stretching from a supertype down to a concrete implementation. |
| public boolean | Returns: true if obj is an instanceof className, false if notThe name of the class className, Object The object to test to see if it's an instance
of the named class obj)Is the given object an instance of the named class? |
| public boolean | Returns: true if it is a varargs methodA member method member)Return true if the method or constructor supports varargs. |
| public static boolean | Returns: true if it's a primitive typeThe name of the Java type typeName)Determine whether a type is a Java primitive, like int or boolean |
| public static String | Returns: The Java-language-style type nameThe String that contains the JVM type name clazz)Translate a JVM-style type descriptor to a Java-language-style type name. |
| private Member | Returns: the matched methodthe class who holds the methods receiverClass, String the name of method methodName, Class<T>[] object type classes of input parameters paramClasses, Class<T>[] primitive type classes or null primParamClasses, boolean[] isParam (for ?) array isParam, boolean static method or not staticMethod, boolean repeatLastParameter, Member[] method stack methods, boolean hasVarargs)Tricky function to resolve a method. |
| private boolean | signatureConvertableFromTo(Class<T>[]
from types' classes fromTypes, Class<T>[] primitive from types or null primFromTypes, Class<T>[] to types' classes toTypes, boolean[] is parameter (?) or not isParam, boolean mixing object/primitive types for comparison mixTypes)Can we convert a signature from fromTypes(primFromTypes) to toTypes. |
| BIGDECIMAL_TYPE_NAME | back to summary |
|---|---|
| private static final String BIGDECIMAL_TYPE_NAME | |
| cf | back to summary |
|---|---|
| private final ClassFactory cf | |
| nonPrimTypeNames | back to summary |
|---|---|
| private static final String[] nonPrimTypeNames | |
| OBJECT_TYPE_NAME | back to summary |
|---|---|
| private static final String OBJECT_TYPE_NAME | |
| primTypeNames | back to summary |
|---|---|
| private static final String[] primTypeNames | |
| STRING_TYPE_NAME | back to summary |
|---|---|
| private static final String STRING_TYPE_NAME | |
| ClassInspector | back to summary |
|---|---|
| public ClassInspector(ClassFactory cf) DO NOT USE! use the method in ClassFactory.
| |
| accessible | back to summary |
|---|---|
| public boolean accessible(String className) throws ClassNotFoundException Does the named class exist, and is it accessible?
| |
| addResolvedTypes | back to summary |
|---|---|
| private void addResolvedTypes(HashMap<Type, Type> resolvedTypes, 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. | |
| assignableTo | back to summary |
|---|---|
| public boolean assignableTo(String fromClassName, String toClassName) Is one named class assignable to another named class or interface? | |
| boundType | back to summary |
|---|---|
| private Class Get the bounds for a single type variable. | |
| classConvertableFromTo | back to summary |
|---|---|
| protected boolean classConvertableFromTo(Class<T> fromClass, Class<T> toClass, boolean mixTypes) Can we convert a fromClass to toClass. "mixTypes" is a flag to show if object/primitive type conversion is possible; this is used for comparing two candidate methods in the second pass of the two pass method resolution. | |
| findPublicConstructor | back to summary |
|---|---|
| public Member findPublicConstructor(String receiverType, String[] parmTypes, String[] primParmTypes, boolean[] isParam) throws ClassNotFoundException, StandardException Find a public constructor that implements a given signature.
The signature is given using the full Java class names of the types.
| |
| findPublicField | back to summary |
|---|---|
| public Member findPublicField(String receiverType, String fieldName, boolean staticField) throws StandardException Find a public field for a class. This follows the semantics of the java compiler for locating a field. This means if a field fieldName exists in the class with package, private or protected then an error is raised. Even if the field hides a field fieldName in a super-class/super--interface. See the JVM spec on fields.
| |
| findPublicMethod | back to summary |
|---|---|
| public Member findPublicMethod(String receiverType, String methodName, String[] parmTypes, String[] primParmTypes, boolean[] isParam, boolean staticMethod, boolean repeatLastParameter, boolean hasVarargs) throws ClassNotFoundException, StandardException Find a public method that implements a given signature.
The signature is given using the full Java class names of the types.
| |
| findTypeBounds | back to summary |
|---|---|
| private Class Get the type bounds for all of the type variables of the given parameterized type. | |
| getClass | back to summary |
|---|---|
| public Class Get (load) the class for the given class name. This method converts any java language class name into a Class object. This includes cases like String[] and primitive types. This will attempt to load the class from the application set.
| |
| getDeclaringClass | back to summary |
|---|---|
| public String getDeclaringClass(Member method) Get the declaring class for a method.
| |
| getGenericParameterTypes | back to summary |
|---|---|
| public Class Given an implementation of a parameterized interface, return the actual types of the interface type variables. May return null or an array of nulls if type resolution fails.
| |
| getParameterTypes | back to summary |
|---|---|
| public String[] getParameterTypes(Member method) Get the parameter types for a method described by a Member as a String[]. | |
| getParameterTypes | back to summary |
|---|---|
| private ArrayList Given a map of resolved types, compose them together in order to resolve the actual concrete types that are plugged into the parameterized type. | |
| getRawType | back to summary |
|---|---|
| private Class Get the raw type of a type bound. | |
| getResolvedTypes | back to summary |
|---|---|
| private HashMap 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. | |
| getType | back to summary |
|---|---|
| public String getType(Member member) Get the Java name of the return type from a Member representing a method or the type of a Member representing a field. | |
| getTypeBounds | back to summary |
|---|---|
| public Class Given an implementation of a parameterized interface, return the bounds on the type variables. May return null if type resolution fails.
| |
| getTypeChain | back to summary |
|---|---|
| private ArrayList Construct an inheritance chain of types stretching from a supertype down to a concrete implementation. | |
| instanceOf | back to summary |
|---|---|
| public boolean instanceOf(String className, Object obj) throws ClassNotFoundException Is the given object an instance of the named class?
| |
| isVarArgsMethod | back to summary |
|---|---|
| public boolean isVarArgsMethod(Member member) Return true if the method or constructor supports varargs.
| |
| primitiveType | back to summary |
|---|---|
| public static boolean primitiveType(String typeName) Determine whether a type is a Java primitive, like int or boolean
| |
| readableClassName | back to summary |
|---|---|
| public static String readableClassName(Class<T> clazz) Translate a JVM-style type descriptor to a Java-language-style type name. | |
| resolveMethod | back to summary |
|---|---|
| private Member resolveMethod(Class<T> receiverClass, String methodName, Class<T>[] paramClasses, Class<T>[] primParamClasses, boolean[] isParam, boolean staticMethod, boolean repeatLastParameter, Member[] methods, boolean hasVarargs) throws StandardException Tricky function to resolve a method. If primParamClasses is null we know it's first pass. First pass try to match as all "object" types, second pass try to match any combination of "object" and "primitive" types. Find the closest match among all the qualified candidates. If there's a tie, it's ambiguous. The preceding paragraph is a bit misleading. As of release 10.4, the second pass did not consider arbitrary combinations of primitive and wrapper types. This is because the first pass removed from consideration candidates which would be allowed under ANSI rules. As a fix for bug DERBY-3652, we now allow primitive and wrapper type matches during the first pass. The ANSI rules are documented in DERBY-3652.
| |
| signatureConvertableFromTo | back to summary |
|---|---|
| private boolean signatureConvertableFromTo(Class<T>[] fromTypes, Class<T>[] primFromTypes, Class<T>[] toTypes, boolean[] isParam, boolean mixTypes) Can we convert a signature from fromTypes(primFromTypes) to toTypes. "mixTypes" is a flag to show if object/primitive type conversion is possible; this is used for comparing two candidate methods in the second pass of the two pass method resolution. | |