net.sf.saffron.util
Class BarfingInvocationHandler

java.lang.Object
  |
  +--net.sf.saffron.util.BarfingInvocationHandler
All Implemented Interfaces:
InvocationHandler
Direct Known Subclasses:
SqlNode.DatabaseMetaDataInvocationHandler

public class BarfingInvocationHandler
extends Object
implements InvocationHandler

A class derived from 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.

Since:
Dec 23, 2002
Version:
$Id: //open/saffron/src/net/sf/saffron/util/BarfingInvocationHandler.java#2 $
Author:
jhyde
See Also:
DelegatingInvocationHandler

Constructor Summary
protected BarfingInvocationHandler()
           
 
Method Summary
 Object invoke(Object proxy, Method method, Object[] args)
           
protected  UnsupportedOperationException noMethod(Method method)
          Called when this class (or its derived class) does not have the required method from the interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BarfingInvocationHandler

protected BarfingInvocationHandler()
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Specified by:
invoke in interface InvocationHandler
Throwable

noMethod

protected UnsupportedOperationException noMethod(Method method)
Called when this class (or its derived class) does not have the required method from the interface.


SourceForge.net_Logo