Class RelaxedDuckType
java.lang.Object
org.eclipse.nebula.widgets.compositetable.internal.DuckType
org.eclipse.nebula.widgets.compositetable.internal.RelaxedDuckType
- All Implemented Interfaces:
java.lang.reflect.InvocationHandler
public class RelaxedDuckType extends DuckType implements java.lang.reflect.InvocationHandler
RelaxedDuckType. Implements Duck Typing for Java. ("If it walks like a duck,
quacks like a duck, it..."). Essentially allows programs to treat
objects from separate hierarchies as if they were designed with common
interfaces as long as they adhere to common naming conventions.
This version is the relaxed DuckType. If a method in the interface is not present on the underlying object, the proxy simply returns null.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.nebula.widgets.compositetable.internal.DuckType
DuckType.Wrapper
-
Field Summary
Fields inherited from class org.eclipse.nebula.widgets.compositetable.internal.DuckType
object, objectClass
-
Constructor Summary
Constructors Modifier Constructor Description protected
RelaxedDuckType(java.lang.Object object)
-
Method Summary
Modifier and Type Method Description static java.lang.Object
implement(java.lang.Class interfaceToImplement, java.lang.Object object)
static boolean
includes(java.lang.Object object, java.lang.String method, java.lang.Class[] args)
java.lang.Object
invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args)
Methods inherited from class org.eclipse.nebula.widgets.compositetable.internal.DuckType
equals, hashCode, instanceOf
-
Constructor Details
-
RelaxedDuckType
protected RelaxedDuckType(java.lang.Object object)
-
-
Method Details
-
implement
public static java.lang.Object implement(java.lang.Class interfaceToImplement, java.lang.Object object) -
includes
public static boolean includes(java.lang.Object object, java.lang.String method, java.lang.Class[] args) -
invoke
public java.lang.Object invoke(java.lang.Object proxy, java.lang.reflect.Method method, java.lang.Object[] args) throws java.lang.Throwable
-