Class MessageBuilderInvocationHandler
- java.lang.Object
-
- org.fluentlenium.core.conditions.message.MessageBuilderInvocationHandler
-
- All Implemented Interfaces:
InvocationHandler
public class MessageBuilderInvocationHandler extends Object implements InvocationHandler
Invocation handler that builds message based on called performed.
-
-
Constructor Summary
Constructors Constructor Description MessageBuilderInvocationHandler(String context)
Creates a new message builder invocation handler.MessageBuilderInvocationHandler(String context, Object instance)
Creates a new message builder invocation handler.MessageBuilderInvocationHandler(List<MessageBuilderCall> calls)
Creates a new message builder invocation handler, with initial calls.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
buildMessage()
Build the message based on annotations from methods called previously.Object
invoke(Object proxy, Method method, Object[] args)
-
-
-
Constructor Detail
-
MessageBuilderInvocationHandler
public MessageBuilderInvocationHandler(String context)
Creates a new message builder invocation handler.- Parameters:
context
- base context of the generated message
-
MessageBuilderInvocationHandler
public MessageBuilderInvocationHandler(String context, Object instance)
Creates a new message builder invocation handler.- Parameters:
context
- base context of the generated messageinstance
- underlying wrapped instance. If not null, calls will also be performed on this instance.
-
MessageBuilderInvocationHandler
public MessageBuilderInvocationHandler(List<MessageBuilderCall> calls)
Creates a new message builder invocation handler, with initial calls.- Parameters:
calls
- initial calls.
-
-
Method Detail
-
invoke
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- Specified by:
invoke
in interfaceInvocationHandler
- Throws:
Throwable
-
buildMessage
public String buildMessage()
Build the message based on annotations from methods called previously.- Returns:
- built message
- Throws:
IllegalStateException
- if one of the recorded call has no @Message/@NotMessage annotation.
-
-