com.jniwrapper.macosx.cocoa
Class Method

java.lang.Object
  extended bycom.jniwrapper.Parameter
      extended bycom.jniwrapper.Callback
          extended bycom.jniwrapper.macosx.cocoa.Method
All Implemented Interfaces:
com.jniwrapper.PointerParameter

public abstract class Method
extends com.jniwrapper.Callback


Field Summary
 
Fields inherited from class com.jniwrapper.Callback
e
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
protected Method(CClass cclass)
          Constructs a method instance.
  Method(CClass cclass, Sel sel, com.jniwrapper.Parameter[] params, com.jniwrapper.Parameter retVal)
          Constructs a method instance.
 
Method Summary
protected  Id getId()
           
protected  Sel getSel()
           
protected  void init(Sel sel, com.jniwrapper.Parameter[] params, com.jniwrapper.Parameter retVal)
          Initializes method parameters.
protected  void invokeOriginal(com.jniwrapper.Parameter returnValue, com.jniwrapper.Parameter[] parameters)
          Invokes the original class method with the passed parameters.
 void register()
          Override method implementation
 void unregister()
          Restore the original method implementation
 
Methods inherited from class com.jniwrapper.Callback
, a, callback, callback, clone, createReturnValueByFields, dispose, getCallingConvention, getDebugInfo, getLength, getParameters, getReturnValue, init, isChildCall, isNull, isUseFieldsForCallbackParameters, read, restoreState, saveState, setCallingConvention, setUseFieldsForCallbackParameters, toPointer, write
 
Methods inherited from class com.jniwrapper.Parameter
a, a, acceptIOPerformer, asReturnValue, b, dataBufferAssigned, equals, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, hashCode, indent, pop, push, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Method

protected Method(CClass cclass)
Constructs a method instance. If a subclass uses this method to construct a method, it must then invoke the init() to initialize method arguments/return.

Parameters:
cclass - objective-c class

Method

public Method(CClass cclass,
              Sel sel,
              com.jniwrapper.Parameter[] params,
              com.jniwrapper.Parameter retVal)
Constructs a method instance.

Parameters:
cclass - objective-c class
sel - selector to original method
params - method function arguments
retVal - method function return value
Method Detail

init

protected final void init(Sel sel,
                          com.jniwrapper.Parameter[] params,
                          com.jniwrapper.Parameter retVal)
Initializes method parameters.

Parameters:
sel - selector to method
params - callback function arguments
retVal - callback function return value

getId

protected Id getId()

getSel

protected Sel getSel()

register

public void register()
Override method implementation


unregister

public void unregister()
Restore the original method implementation


invokeOriginal

protected final void invokeOriginal(com.jniwrapper.Parameter returnValue,
                                    com.jniwrapper.Parameter[] parameters)
                             throws com.jniwrapper.FunctionExecutionException
Invokes the original class method with the passed parameters. A type of the return value and parameter types should correspond to types of the native code function.

Parameters:
returnValue - reference to return value
parameters - array of parameters of called function
Throws:
com.jniwrapper.FunctionExecutionException