Package manifold.ext.rt.api
Interface ICallHandler
-
- All Known Implementing Classes:
MapStructExt
public interface ICallHandlerFacilitates dynamic interface method invocation. A class can directly or indirectly, via interface extension, implement this interface to support dynamic interface method invocation. Any class implementing this interface can be cast to any interface. Manifold cooperates with the Java compiler to transform calls through an interface to ICallHandler.call(). Note unlike a proxy or wrapper a class implementing ICallHandler doesn't wrap anything, therefore it doesn't lose its identity in the process of making calls.- See Also:
- "MapStructExt"
-
-
Field Detail
-
UNHANDLED
static final Object UNHANDLED
A value resulting from #call() indicating the call could not be dispatched.
-
-
Method Detail
-
call
Object call(Object proxy, Class<?> iface, String name, String actualName, Class<?> returnType, Class<?>[] paramTypes, Object[] args)
Dispatch a call to an interface method.- Parameters:
proxy- The proxy instance delegating this call, null if not a proxyiface- The extended interface and owner of the methodname- The name of the methodactualName- The actual name of the property associated with the method e.g., a Json name that is not a legal Java identifier, can be nullreturnType- The return type of the methodparamTypes- The parameter types of the methodargs- The arguments from the call site- Returns:
- The result of the method call or UNHANDLED if the method is not dispatched. Null if the method's return type is void.
-
-