org.identityconnectors.common
Class ReflectionUtil

java.lang.Object
  extended by org.identityconnectors.common.ReflectionUtil

public class ReflectionUtil
extends Object


Method Summary
static boolean containsInterface(Class<?> target, Class<?> clazz)
          Determine if the target class implements the provided interface.
static Set<Class<?>> getAllInterfaces(Class<?> target)
          Builds a Set of interfaces from the target class.
static
<T> List<Class<? extends T>>
getInterfaces(Class<?> target, Class<T> type)
          Get all interfaces the extends the type provided.
static String getMethodName(int depth)
          Determine the method name for the calling class.
static String getPackage(Class<?> clazz)
          Returns the package the class is associated with.
static boolean overridesEqualsAndHashcode(Class<?> clazz)
          Returns true iff the given class overrides equals and hashCode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllInterfaces

public static Set<Class<?>> getAllInterfaces(Class<?> target)
Builds a Set of interfaces from the target class.


containsInterface

public static boolean containsInterface(Class<?> target,
                                        Class<?> clazz)
Determine if the target class implements the provided interface.

Parameters:
target - class to look through for a matching interface.
clazz - interface class to look for.
Returns:
true if a matching interface is found otherwise false.

getInterfaces

public static <T> List<Class<? extends T>> getInterfaces(Class<?> target,
                                                         Class<T> type)
Get all interfaces the extends the type provided.


overridesEqualsAndHashcode

public static boolean overridesEqualsAndHashcode(Class<?> clazz)
Returns true iff the given class overrides equals and hashCode

Parameters:
clazz - The class to check.
Returns:
True iff the given class overrides equals and hashCode

getPackage

public static String getPackage(Class<?> clazz)
Returns the package the class is associated with.

Parameters:
clazz - class to inspect for the package.
Returns:
package for the class provided.
Throws:
NullPointerException - iff clazz is null.

getMethodName

public static String getMethodName(int depth)
Determine the method name for the calling class.



Copyright © 2012. All Rights Reserved.