Package de.alpharogroup.model.reflect
Class Evaluation<R>
- java.lang.Object
-
- de.alpharogroup.model.reflect.Evaluation<R>
-
- All Implemented Interfaces:
IProxyFactory.Callback
public class Evaluation<R> extends java.lang.Object implements IProxyFactory.Callback
An evaluation of method invocations.
-
-
Field Summary
Fields Modifier and Type Field Description static IProxyFactory
proxyFactory
The factory for proxies.java.util.List<java.lang.Object>
stack
Each invoked method followed by its arguments.
-
Constructor Summary
Constructors Constructor Description Evaluation(java.lang.reflect.Type type)
Evaluation of method invocations on the given type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <R> Evaluation<R>
eval(R result)
Reverse operation ofproxy()
, i.e. get the evaluation from an evaluation result.static <T> T
of(java.lang.Class<T> type)
Start evaluation from the give type.java.lang.Object
on(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] parameters)
Handle an invocation on a result proxy.java.lang.Object
proxy()
Create a proxy for the current type.
-
-
-
Field Detail
-
proxyFactory
public static IProxyFactory proxyFactory
The factory for proxies.
-
stack
public final java.util.List<java.lang.Object> stack
Each invoked method followed by its arguments.
-
-
Method Detail
-
eval
public static <R> Evaluation<R> eval(R result)
Reverse operation ofproxy()
, i.e. get the evaluation from an evaluation result.- Type Parameters:
R
- the generic type- Parameters:
result
- invocation result- Returns:
- evaluation
-
of
public static <T> T of(java.lang.Class<T> type)
Start evaluation from the give type.- Type Parameters:
T
- the generic type- Parameters:
type
- starting type- Returns:
- proxy
-
on
public java.lang.Object on(java.lang.Object obj, java.lang.reflect.Method method, java.lang.Object[] parameters) throws java.lang.Throwable
Handle an invocation on a result proxy.- Specified by:
on
in interfaceIProxyFactory.Callback
- Returns:
- proxy for the invocation result
- Throws:
java.lang.Throwable
- See Also:
proxy()
-
proxy
public java.lang.Object proxy()
Create a proxy for the current type.If the result cannot be proxied, it is accessible via
lastNonProxyable
.- Returns:
- proxy or
null
if invocation result cannot be proxied
-
-