Class Message

java.lang.Object
ca.weblite.objc.Message

public class Message extends Object
A structure the encapsulates a message. This is an optional alternative way of sending messages to the Objective-C runtime.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    List of arguments to pass to the method invocation.
    boolean
    Whether to coerce the input of the message.
    boolean
    Whether to coerce the output of the message.
    If there was en error in the message handling, the error will be saved here.
    boolean
    Whether the input was, in fact coerced.
    Reference to the next message in the message chain.
    boolean
    Whether the output was, in fact, coerced.
    Reference to the previous message in the message chain.
    com.sun.jna.Pointer
    The target of the message.
    Placeholder for the result of the message.
    com.sun.jna.Pointer
    The selector of the message.
    int
    The current status of the message.
    static final int
    Status identifier of a message to indicate that is has been cancelled.
    static final int
    Status identifier of a message to indicated that it has been completed.
    static final int
    Status identifier of a message to indicate that it is ready to be sent.
    static final int
    Status identifier of a message to indicate that it has been skipped.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Method that is called just after the message is send and response received.
    void
    Method that is called just before the message is sent.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • STATUS_SKIPPED

      public static final int STATUS_SKIPPED
      Status identifier of a message to indicate that it has been skipped.
      See Also:
    • STATUS_CANCELLED

      public static final int STATUS_CANCELLED
      Status identifier of a message to indicate that is has been cancelled.
      See Also:
    • STATUS_COMPLETED

      public static final int STATUS_COMPLETED
      Status identifier of a message to indicated that it has been completed.
      See Also:
    • STATUS_READY

      public static final int STATUS_READY
      Status identifier of a message to indicate that it is ready to be sent.
      See Also:
    • receiver

      public com.sun.jna.Pointer receiver
      The target of the message.
    • selector

      public com.sun.jna.Pointer selector
      The selector of the message.
    • args

      public List args
      List of arguments to pass to the method invocation.
    • result

      public Object result
      Placeholder for the result of the message. (i.e. return value).
    • error

      public Exception error
      If there was en error in the message handling, the error will be saved here.
    • status

      public int status
      The current status of the message. Before running, its status should be STATUS_READY, and after running, it should be STATUS_COMPLETED. If, for some reason it has been cancelled or skipped, then it could have those statuses also.
    • coerceInput

      public boolean coerceInput
      Whether to coerce the input of the message.
    • coerceOutput

      public boolean coerceOutput
      Whether to coerce the output of the message.
    • inputWasCoerced

      public boolean inputWasCoerced
      Whether the input was, in fact coerced. Set when the message is run.
    • outputWasCoerced

      public boolean outputWasCoerced
      Whether the output was, in fact, coerced. Set when the message is run.
    • next

      public Message next
      Reference to the next message in the message chain.
    • previous

      public Message previous
      Reference to the previous message in the message chain.
  • Constructor Details

    • Message

      public Message()
  • Method Details

    • beforeRequest

      public void beforeRequest()
      Method that is called just before the message is sent. This can be overridden to change the parameters, skip the message, or cancel the message chain altogether.
    • afterResponse

      public void afterResponse()
      Method that is called just after the message is send and response received. This can be overridden to do post processing, like changing the settings of subsequent messages in the chain or doing processing based on the output of the message.