Evaluating Software Design Patterns
— the "Gang of Four" patterns implemented in Java 6

dk.rode.thesis.meta.reflect
Class ExecutorProcessor

java.lang.Object
  extended by dk.rode.thesis.meta.reflect.ExecutorProcessor

public class ExecutorProcessor
extends Object

The executor processor provides methods to retrieve methods and/or constructors annotated with the Executor annotation.

Author:
Gunni Rode / rode.dk
See Also:
Executor

Constructor Summary
private ExecutorProcessor()
          Private off-limit constructor.
 
Method Summary
static List<Constructor<?>> getConstructorExecutors(Class<?> clazz, Class<?> context, Class<?>... parameterTypes)
          Returns all declared constructors annotated with the Executor annotation in the class supplied as clazz, where the formal parameter types match parameterTypes ignoring primitives, and where the context is assignable from context.
static List<Method> getMethodExecutors(Class<?> clazz, Class<?> context, Class<?>... parameterTypes)
          Returns all declared methods annotated with the Executor annotation in the class supplied as clazz, where the formal parameter types match parameterTypes ignoring primitives, and where the context is assignable from context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutorProcessor

private ExecutorProcessor()
Private off-limit constructor.

Method Detail

getConstructorExecutors

public static final List<Constructor<?>> getConstructorExecutors(Class<?> clazz,
                                                                 Class<?> context,
                                                                 Class<?>... parameterTypes)
Returns all declared constructors annotated with the Executor annotation in the class supplied as clazz, where the formal parameter types match parameterTypes ignoring primitives, and where the context is assignable from context.

Parameters:
clazz - The class; cannot be null.
context - The context; cannot be null.
parameterTypes - The formal parameter types for the methods; can be empty.
Returns:
A list containing the proper annotated constructors in clazz, if any; never null, but may be empty.
Throws:
NullPointerException - If clazz or context are null.

getMethodExecutors

public static final List<Method> getMethodExecutors(Class<?> clazz,
                                                    Class<?> context,
                                                    Class<?>... parameterTypes)
Returns all declared methods annotated with the Executor annotation in the class supplied as clazz, where the formal parameter types match parameterTypes ignoring primitives, and where the context is assignable from context.

Parameters:
clazz - The class; cannot be null.
context - The context; cannot be null.
parameterTypes - The formal parameter types for the methods; can be empty.
Returns:
A list containing the proper annotated methods in clazz, if any; never null, but may be empty.
Throws:
NullPointerException - If clazz or context are null.

Gunni Rode / rode.dk

Feel free to use and/or modify the Java 6 source code developed for this thesis AT YOUR OWN RISK, but note that the source code comes WITHOUT ANY — and I do mean WITHOUT ANY — form of warranty WHAT SO EVER!

The original thesis and source code are available at rode.dk/thesis.