Spring Hateoas

org.springframework.hateoas.core
Class DummyInvocationUtils

java.lang.Object
  extended by org.springframework.hateoas.core.DummyInvocationUtils

public class DummyInvocationUtils
extends Object

Utility methods to capture dummy method invocations.

Author:
Oliver Gierke

Nested Class Summary
static interface DummyInvocationUtils.LastInvocationAware
           
static interface DummyInvocationUtils.MethodInvocation
           
 
Constructor Summary
DummyInvocationUtils()
           
 
Method Summary
static
<T> T
methodOn(Class<T> type, Object... parameters)
          Returns a proxy of the given type, backed by an EmptyTargetSource to simply drop method invocations but equips it with an InvocationRecordingMethodInterceptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyInvocationUtils

public DummyInvocationUtils()
Method Detail

methodOn

public static <T> T methodOn(Class<T> type,
                             Object... parameters)
Returns a proxy of the given type, backed by an EmptyTargetSource to simply drop method invocations but equips it with an InvocationRecordingMethodInterceptor. The interceptor records the last invocation and returns a proxy of the return type that also implements DummyInvocationUtils.LastInvocationAware so that the last method invocation can be inspected. Parameters passed to the subsequent method invocation are generally neglected except the ones that might be mapped into the URI translation eventually, e.g. in the case of Spring MVC. Note, that the return types of the methods have to be capable to be proxied.

Parameters:
type - must not be null.
parameters - parameters to extend template variables in the type level mapping.
Returns:

Spring Hateoas

Copyright © 2012-2014-2014 Pivotal, Inc.. All Rights Reserved.