|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.groovy.runtime.ConversionHandler
public abstract class ConversionHandler
This class is a general adapter to map a call to a Java interface to a given delegate.
Constructor Summary | |
---|---|
ConversionHandler(Object delegate)
Creates a ConversionHandler with an delegate. |
Method Summary | |
---|---|
protected boolean |
checkMethod(Method method)
|
boolean |
equals(Object obj)
Indicates whether some other object is "equal to" this one. |
Object |
getDelegate()
Returns the delegate. |
int |
hashCode()
Returns a hash code value for the delegate. |
Object |
invoke(Object proxy,
Method method,
Object[] args)
This method is a default implementation for the invoke method given in Invocationhandler. |
abstract Object |
invokeCustom(Object proxy,
Method method,
Object[] args)
This method is called for all Methods not defined on Object. |
static boolean |
isCoreObjectMethod(Method method)
Checks whether a method is a core method from java.lang.Object. |
String |
toString()
Returns a String version of the delegate. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConversionHandler(Object delegate)
delegate
- the delegate
IllegalArgumentException
- if the given delegate is nullMethod Detail |
---|
public Object getDelegate()
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
invoke
in interface InvocationHandler
proxy
- the proxymethod
- the methodargs
- the arguments
Throwable
- if caused by the delegate or the methodinvokeCustom(Object, Method, Object[])
,
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
protected boolean checkMethod(Method method)
public abstract Object invokeCustom(Object proxy, Method method, Object[] args) throws Throwable
proxy
- the proxymethod
- the methodargs
- the arguments
Throwable
- any exception causes by the delegateinvoke(Object, Method, Object[])
,
InvocationHandler.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public String toString()
toString
in class Object
Object.toString()
public static boolean isCoreObjectMethod(Method method)
method
- the method to check
|
Copyright © 2003-2009 The Codehaus. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |