org.omnaest.utils.proxy
Class MethodName

java.lang.Object
  extended by org.omnaest.utils.proxy.MethodName

public class MethodName
extends Object

See Also:
MethodCallCapturer, BeanProperty

Field Summary
protected  MethodCallCapturer methodCallCapturer
           
 
Constructor Summary
  MethodName()
           
protected MethodName(MethodCallCapturer methodCallCapturer)
           
 
Method Summary
<E> E
newInstanceOfCapturedType(Class<? extends E> clazz)
          Creates a new stub instance for the given class or interface type for which the method calls will be captured.
<E> E
newInstanceOfTransitivlyCapturedType(Class<? extends E> clazz)
          Creates a new stub instance for the given class or interface type for which the method calls will be captured.
 String[] of(Object... methodCalls)
           TestInterface testInterface = this.methodName.newInstanceOfTransitivlyCapturedType( TestInterface.class );

String[] methodNames = this.methodName.of( testInterface.doSomething( "text value" ), testInterface.doSomethingPrimitive( "primitive text" ), testInterface.doTestSubInterface().doCalculateSomething() );
 String of(Object methodCall)
          Returns the canonical method name of the last method call done from the stub created by the newInstanceOfCapturedType(Class) method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

methodCallCapturer

protected MethodCallCapturer methodCallCapturer
Constructor Detail

MethodName

protected MethodName(MethodCallCapturer methodCallCapturer)
Parameters:
methodCallCapturer -
See Also:
MethodName

MethodName

public MethodName()
See Also:
MethodName
Method Detail

of

public String of(Object methodCall)
Returns the canonical method name of the last method call done from the stub created by the newInstanceOfCapturedType(Class) method.

This should be used like

 {
   TestInterface testInterface = this.methodName.newInstanceOfTransitivlyCapturedType( TestInterface.class );
   String methodName = this.methodName.of( testInterface.doSomething( "text value" ) );
 }
 


where the stub is a previously created stub by this MethodCallCapturer instance.

Parameters:
object -
Returns:
See Also:
newInstanceOfCapturedType(Class)

of

public String[] of(Object... methodCalls)
TestInterface testInterface = this.methodName.newInstanceOfTransitivlyCapturedType( TestInterface.class );

String[] methodNames = this.methodName.of( testInterface.doSomething( "text value" ), testInterface.doSomethingPrimitive( "primitive text" ), testInterface.doTestSubInterface().doCalculateSomething() );

Parameters:
methodCalls -
Returns:
See Also:
of(Object)

newInstanceOfCapturedType

public <E> E newInstanceOfCapturedType(Class<? extends E> clazz)
Creates a new stub instance for the given class or interface type for which the method calls will be captured. The capturing is not transitive which means that method calls of nested objects / fields are not captured.

Type Parameters:
E -
Parameters:
clazz -
Returns:
See Also:
newInstanceOfTransitivlyCapturedType(Class), of(Object)

newInstanceOfTransitivlyCapturedType

public <E> E newInstanceOfTransitivlyCapturedType(Class<? extends E> clazz)
Creates a new stub instance for the given class or interface type for which the method calls will be captured. This stub captures transitive method calls for field objects and further child nodes within the object hierarchy as well.

Type Parameters:
E -
Parameters:
clazz -
Returns:
See Also:
newInstanceOfCapturedType(Class)


Copyright © 2013. All Rights Reserved.