Class Evaluation<R>

    • 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 of proxy(), 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
    • Constructor Detail

      • Evaluation

        public Evaluation​(java.lang.reflect.Type type)
        Evaluation of method invocations on the given type.
        Parameters:
        type - starting type
    • Method Detail

      • eval

        public static <R> Evaluation<R> eval​(R result)
        Reverse operation of proxy(), 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 interface IProxyFactory.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