|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.compare.util.ClassUtils
public final class ClassUtils
Provides utility methods to get information on Class
objects.
Method Summary | |
---|---|
static boolean |
classEquals(java.lang.Class<?> class1,
java.lang.Class<?> class2)
This will test equality between two classes. |
static boolean |
hasMethod(java.lang.Class<?> clazz,
java.lang.String methodName,
java.lang.Class<?>... parameters)
Iterates through a given Class public Method s to determine if it declares a method of
the given name and parameters. |
static java.lang.Object |
invokeMethod(java.lang.Object object,
java.lang.String methodName,
java.lang.Object... parameters)
Convenience method to reflectively invoke a given method on the given object with the given parameters. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean classEquals(java.lang.Class<?> class1, java.lang.Class<?> class2)
We'll assume that primitives types are equal to their wrappers so that
parameterEquals(java.lang.Integer, int)
returns True
.
class1
- First of the two classes to test for equality.class2
- Second of the two classes to test for equality.
True
if the two classes are considered equal, False
otherwise.public static boolean hasMethod(java.lang.Class<?> clazz, java.lang.String methodName, java.lang.Class<?>... parameters)
Class
public Method
s to determine if it declares a method of
the given name and parameters.
clazz
- Class
to visit.methodName
- Name of the method we search for.parameters
- Types of the researched method parameters.
True
if the given Class
object declares a Method
called
methodName
.public static java.lang.Object invokeMethod(java.lang.Object object, java.lang.String methodName, java.lang.Object... parameters)
null
if it does not.
object
- Invocation target.methodName
- Name of the method to invoke.parameters
- Parameters with which to invoke the method.
null
if the method does not exist according to
hasMethod(Class, String, Class...)
.
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |