org.apache.commons.proxy.invoker
Class NullInvoker

java.lang.Object
  extended by org.apache.commons.proxy.invoker.NullInvoker
All Implemented Interfaces:
Invoker

public class NullInvoker
extends Object
implements Invoker

An Invoker implementation which merely returns null for all method invocations. This class is useful for scenarios where the "null object" design pattern is needed.

Since:
1.0
Author:
James Carman

Constructor Summary
NullInvoker()
           
 
Method Summary
 Object invoke(Object proxy, Method method, Object[] args)
          "Invokes" the method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullInvoker

public NullInvoker()
Method Detail

invoke

public Object invoke(Object proxy,
                     Method method,
                     Object[] args)
              throws Throwable
Description copied from interface: Invoker
"Invokes" the method. Implementation should throw a InvokerException if problems arise while trying to invoke the method.

Specified by:
invoke in interface Invoker
Parameters:
proxy - the proxy object
method - the method being invoked
args - the arguments
Returns:
the return value
Throws:
Throwable - thrown by the implementation


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.