|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.javimmutable.collections.util.ReflectionFunctions
public final class ReflectionFunctions
Contains static constructors for creating FuncN objects that call methods using reflection.
Nested Class Summary | |
---|---|
static class |
ReflectionFunctions.ReflectionException
Encapsulates the various checked exceptions that can be thrown by the java reflection methods. |
static class |
ReflectionFunctions.StaticMismatchException
Exception thrown if caller requests a static class but reflection finds a non-static class (or vice versa). |
Method Summary | ||
---|---|---|
static
|
method(Object obj,
String name)
Returns a Func0 instance that calls the specified non-static method on the specified java object. |
|
static
|
method(Object obj,
String name,
Class<P1> arg1Class)
Returns a Func1 instance that calls the specified non-static method on the specified java object. |
|
static
|
method(Object obj,
String name,
Class<P1> arg1Class,
Class<P2> arg2Class)
Returns a Func2 instance that calls the specified non-static method on the specified java object. |
|
static
|
method(Object obj,
String name,
Class<P1> arg1Class,
Class<P2> arg2Class,
Class<P3> arg3Class)
Returns a Func3 instance that calls the specified non-static method on the specified java object. |
|
static
|
method(Object obj,
String name,
Class<P1> arg1Class,
Class<P2> arg2Class,
Class<P3> arg3Class,
Class<P4> arg4Class)
Returns a Func4 instance that calls the specified non-static method on the specified java object. |
|
static
|
method(String name,
Class<OT> klass)
Returns a Func1 instance that calls the specified non-static method on a java object passed as the parameter of the function. |
|
static
|
method(String name,
Class<P1> arg1Class,
Class<OT> klass)
Returns a Func2 instance that calls the specified non-static method on a java object passed as the last parameter of the Func2. |
|
static
|
method(String name,
Class<P1> arg1Class,
Class<P2> arg2Class,
Class<OT> klass)
Returns a Func3 instance that calls the specified non-static method on a java object passed as the last parameter of the Func3. |
|
static
|
method(String name,
Class<P1> arg1Class,
Class<P2> arg2Class,
Class<P3> arg3Class,
Class<OT> klass)
Returns a Func4 instance that calls the specified non-static method on a java object passed as the last parameter of the Func4. |
|
static
|
staticMethod(Class klass,
String name)
Returns a Func0 instance that calls the specified static method on the specified java object. |
|
static
|
staticMethod(Class klass,
String name,
Class<P1> arg1Class)
Returns a Func3 instance that calls the specified static method on the specified java object. |
|
static
|
staticMethod(Class klass,
String name,
Class<P1> arg1Class,
Class<P2> arg2Class)
Returns a Func2 instance that calls the specified static method on the specified java object. |
|
static
|
staticMethod(Class klass,
String name,
Class<P1> arg1Class,
Class<P2> arg2Class,
Class<P3> arg3Class)
Returns a Func3 instance that calls the specified static method on the specified java object. |
|
static
|
staticMethod(Class klass,
String name,
Class<P1> arg1Class,
Class<P2> arg2Class,
Class<P3> arg3Class,
Class<P4> arg4Class)
Returns a Func4 instance that calls the specified static method on the specified java object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <R> Func0<R> method(Object obj, String name)
R
- the return type of the functionobj
- the object whose method should be invokedname
- the name of the method to invoke
public static <P1,R> Func1<P1,R> method(Object obj, String name, Class<P1> arg1Class)
P1
- parameter 1 typeR
- the return type of the functionobj
- the object whose method should be invokedname
- the name of the method to invokearg1Class
- Class of parameter 1 of the method
public static <P1,P2,R> Func2<P1,P2,R> method(Object obj, String name, Class<P1> arg1Class, Class<P2> arg2Class)
P1
- parameter 1 typeP2
- parameter 2 typeR
- obj
- the object whose method should be invokedname
- the name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the method
public static <P1,P2,P3,R> Func3<P1,P2,P3,R> method(Object obj, String name, Class<P1> arg1Class, Class<P2> arg2Class, Class<P3> arg3Class)
P1
- parameter 1 typeP2
- parameter 2 typeP3
- parameter 3 typeR
- the return type of the functionobj
- the object whose method should be invokedname
- the name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the methodarg3Class
- Class of parameter 3 of the method
public static <P1,P2,P3,P4,R> Func4<P1,P2,P3,P4,R> method(Object obj, String name, Class<P1> arg1Class, Class<P2> arg2Class, Class<P3> arg3Class, Class<P4> arg4Class)
P1
- parameter 1 typeP2
- parameter 2 typeP3
- parameter 3 typeP4
- parameter 4 typeR
- the return type of the functionobj
- the object whose method should be invokedname
- the name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the methodarg3Class
- Class of parameter 3 of the methodarg4Class
- Class of parameter 4 of the method
public static <OT,R> Func1<OT,R> method(String name, Class<OT> klass)
name
- name of the method to invokeklass
- class of the instance object parameter
public static <P1,OT,R> Func2<P1,OT,R> method(String name, Class<P1> arg1Class, Class<OT> klass)
name
- name of the method to invokearg1Class
- Class of parameter 1 of the methodklass
- class of the instance object parameter
public static <P1,P2,OT,R> Func3<P1,P2,OT,R> method(String name, Class<P1> arg1Class, Class<P2> arg2Class, Class<OT> klass)
name
- name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the methodklass
- class of the instance object parameter
public static <P1,P2,P3,OT,R> Func4<P1,P2,P3,OT,R> method(String name, Class<P1> arg1Class, Class<P2> arg2Class, Class<P3> arg3Class, Class<OT> klass)
name
- name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the methodarg3Class
- Class of parameter 3 of the methodklass
- class of the instance object parameter
public static <R> Func0<R> staticMethod(Class klass, String name)
R
- the return type of the functionname
- the name of the method to invoke
public static <P1,R> Func1<P1,R> staticMethod(Class klass, String name, Class<P1> arg1Class)
P1
- parameter 1 typeR
- the return type of the functionname
- the name of the method to invokearg1Class
- Class of parameter 1 of the method
public static <P1,P2,R> Func2<P1,P2,R> staticMethod(Class klass, String name, Class<P1> arg1Class, Class<P2> arg2Class)
P1
- parameter 1 typeP2
- parameter 2 typeR
- the return type of the functionname
- the name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the method
public static <P1,P2,P3,R> Func3<P1,P2,P3,R> staticMethod(Class klass, String name, Class<P1> arg1Class, Class<P2> arg2Class, Class<P3> arg3Class)
P1
- parameter 1 typeP2
- parameter 2 typeP3
- parameter 3 typeR
- the return type of the functionname
- the name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the methodarg3Class
- Class of parameter 3 of the method
public static <P1,P2,P3,P4,R> Func4<P1,P2,P3,P4,R> staticMethod(Class klass, String name, Class<P1> arg1Class, Class<P2> arg2Class, Class<P3> arg3Class, Class<P4> arg4Class)
P1
- parameter 1 typeP2
- parameter 2 typeP3
- parameter 3 typeP4
- parameter 4 typeR
- the return type of the functionname
- the name of the method to invokearg1Class
- Class of parameter 1 of the methodarg2Class
- Class of parameter 2 of the methodarg3Class
- Class of parameter 3 of the methodarg4Class
- Class of parameter 4 of the method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |