Top Description Fields Constructors Methods
org.eclipse.collections.impl.utility.internal

public final Class ReflectionHelper

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .InvocationTargetException, .Modifier, org.eclipse.collections.api.map.ImmutableMap, org.eclipse.collections.impl.map.mutable.UnifiedMap, org.eclipse.collections.impl.tuple.Tuples, org.eclipse.collections.impl.utility.MapIterate

A utility/helper class for working with Classes and Reflection.

Field Summary

Modifier and TypeField and Description
public static final Class<T>[]
EMPTY_CLASS_ARRAY

Deprecated in 2.0. Will become private in a future version.
private static final ImmutableMap<Class<?>, Class<?>>
private static final ImmutableMap<Class<?>, Class<?>>
WRAPPER_TO_PRIMATIVES

Mapping of iterator wrapper classes to iterator types

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> Constructor<T>
getConstructor(Class<T> instantiable, Class<?>... constructorParameterTypes)

public static boolean
public static <T> T
newInstance(Constructor<T> constructor, Object... constructorArguments)

public static <T> T
newInstance(Class<T> aClass)

This method may return null if the call to create a newInstance() fails.

public static boolean
parameterTypesMatch(Class<?>[] candidateParamTypes, Class<?>... desiredParameterTypes)

private static <T> Constructor<T>
searchForConstructor(Class<T> instantiable, Class<?>... constructorParameterTypes)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

EMPTY_CLASS_ARRAYback to summary
public static final Class<T>[] EMPTY_CLASS_ARRAY

Deprecated

in 2.0. Will become private in a future version.

Annotations
@SuppressWarnings:rawtypes
@Deprecated
PRIMATIVES_TO_WRAPPERSback to summary
private static final ImmutableMap<Class<?>, Class<?>> PRIMATIVES_TO_WRAPPERS
WRAPPER_TO_PRIMATIVESback to summary
private static final ImmutableMap<Class<?>, Class<?>> WRAPPER_TO_PRIMATIVES

Mapping of iterator wrapper classes to iterator types

Constructor Detail

ReflectionHelperback to summary
private ReflectionHelper()

Method Detail

getConstructorback to summary
public static <T> Constructor<T> getConstructor(Class<T> instantiable, Class<?>... constructorParameterTypes)
hasDefaultConstructorback to summary
public static boolean hasDefaultConstructor(Class<?> aClass)
newInstanceback to summary
public static <T> T newInstance(Constructor<T> constructor, Object... constructorArguments)
newInstanceback to summary
public static <T> T newInstance(Class<T> aClass)

This method may return null if the call to create a newInstance() fails.

parameterTypesMatchback to summary
public static boolean parameterTypesMatch(Class<?>[] candidateParamTypes, Class<?>... desiredParameterTypes)
searchForConstructorback to summary
private static <T> Constructor<T> searchForConstructor(Class<T> instantiable, Class<?>... constructorParameterTypes)