Class BarfingInvocationHandler

  • All Implemented Interfaces:
    java.lang.reflect.InvocationHandler
    Direct Known Subclasses:
    SqlUtil.DatabaseMetaDataInvocationHandler

    public class BarfingInvocationHandler
    extends java.lang.Object
    implements java.lang.reflect.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.

    See Also:
    DelegatingInvocationHandler
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • 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 java.lang.Object invoke​(java.lang.Object proxy,
                                       java.lang.reflect.Method method,
                                       java.lang.Object[] args)
                                throws java.lang.Throwable
        Specified by:
        invoke in interface java.lang.reflect.InvocationHandler
        Throws:
        java.lang.Throwable
      • noMethod

        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.