org.wamblee.reflection
Class ReflectionUtils

java.lang.Object
  extended by org.wamblee.reflection.ReflectionUtils

public class ReflectionUtils
extends Object

Some utilities for reflection.

Author:
Erik Brakkee

Field Summary
static List<Class> PRIMITIVE_WRAPPERS
           
 
Constructor Summary
ReflectionUtils()
           
 
Method Summary
static List<Field> getAllFields(Class aClass, Class... aExcludedClasses)
           
static List<Method> getAllMethods(Class aClass, Class... aExcludedClasses)
           
static boolean isPrimitive(Class aClass)
          Checks if a class is a primitive type or wrapper type.
static Class wrapIfNeeded(Class aClass)
          Wraps a type by the corresponding wrapper type if it is a primitive type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIMITIVE_WRAPPERS

public static final List<Class> PRIMITIVE_WRAPPERS
Constructor Detail

ReflectionUtils

public ReflectionUtils()
Method Detail

wrapIfNeeded

public static Class wrapIfNeeded(Class aClass)
Wraps a type by the corresponding wrapper type if it is a primitive type.

Parameters:
aClass - Type to wrap.
Returns:
Wrapped type for primitives or the provided argument value.

getAllMethods

public static List<Method> getAllMethods(Class aClass,
                                         Class... aExcludedClasses)

getAllFields

public static List<Field> getAllFields(Class aClass,
                                       Class... aExcludedClasses)

isPrimitive

public static boolean isPrimitive(Class aClass)
Checks if a class is a primitive type or wrapper type.

Parameters:
aClass -
Returns:


Copyright © 2011. All Rights Reserved.