public class BarfingInvocationHandler
extends java.lang.Object
implements java.lang.reflect.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 |
---|---|
java.lang.Object |
invoke(java.lang.Object proxy,
java.lang.reflect.Method method,
java.lang.Object[] args) |
protected java.lang.UnsupportedOperationException |
noMethod(java.lang.reflect.Method method)
Called when this class (or its derived class) does not have the required
method from the interface.
|
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
invoke
in interface java.lang.reflect.InvocationHandler
java.lang.Throwable
protected java.lang.UnsupportedOperationException noMethod(java.lang.reflect.Method method)
Copyright © 2012–2019 The Apache Software Foundation. All rights reserved.