public class BarfingInvocationHandler extends Object implements InvocationHandler
BarfingInvocationHandler handles a method
call by looking for a method in itself with identical parameters. If no such
method is found, it throws UnsupportedOperationException.
It is useful when you are prototyping code. You can rapidly create a prototype class which implements the important methods in an interface, then implement other methods as they are called.
DelegatingInvocationHandler| Modifier | Constructor and Description |
|---|---|
protected |
BarfingInvocationHandler() |
| Modifier and Type | Method and Description |
|---|---|
@Nullable Object |
invoke(Object proxy,
Method method,
@Nullable Object[] args) |
protected UnsupportedOperationException |
noMethod(Method method)
Called when this class (or its derived class) does not have the required
method from the interface.
|
public @Nullable Object invoke(Object proxy, Method method, @Nullable Object[] args) throws Throwable
invoke in interface InvocationHandlerThrowableprotected UnsupportedOperationException noMethod(Method method)
Copyright © 2012-2022 Apache Software Foundation. All Rights Reserved.