|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.weblite.objc.Client
public class Client
An object-oriented wrapper around the RuntimeUtils static methods for interacting with the Objective-C runtime.
A client object stores settings about whether to coerce inputs and/or outputs from messages. There are two global instances of this class that are used most often:
Client.getInstance() : The default
client with settings to coerce both inputs and outputs. If you
need to make a direct call to the Objective-C runtime, this
is usually the client that you would use.
Client.getRawClient() : Reference
to a simple client that is set to not coerce input and
output. This is handy if you want to pass in the raw Pointers
as parameters, and receive raw pointers as output.
| Constructor Summary | |
|---|---|
Client()
|
|
| Method Summary | |
|---|---|
Message[] |
buildMessageChain(Object... parameters)
Builds a chain of messages that can be executed together at a later time. |
Proxy |
chain(String cls,
com.sun.jna.Pointer selector,
Object... args)
|
Proxy |
chain(String cls,
String selector,
Object... args)
Deprecated. |
boolean |
getCoerceInputs()
Returns the coerceInputs flag. |
boolean |
getCoerceOutputs()
Returns the coerceOutputs flag. |
static Client |
getInstance()
Retrieves the global reference to a client that has both input coercion and output coercion enabled. |
static Client |
getRawClient()
Retrieves singleton instance to a simple client that has type coercion disabled for both inputs and outputs. |
PeerableRecipient |
newObject(Class<? extends PeerableRecipient> cls)
Creates a new peerable and receivable object of the specified class. |
Object |
send(Message... messages)
Sends an array of messages in a chain. |
Object |
send(Peerable proxy,
com.sun.jna.Pointer selector,
Object... args)
Sends a message to an Objective-C object. |
Object |
send(Peerable proxy,
String selector,
Object... args)
Sends a message to an Objective-C object. |
Object |
send(com.sun.jna.Pointer receiver,
com.sun.jna.Pointer selector,
Object... args)
Sends a message to an Objective-C object. |
Object |
send(com.sun.jna.Pointer receiver,
String selector,
Object... args)
Sends a message to an Objective-C object. |
Object |
send(String receiver,
com.sun.jna.Pointer selector,
Object... args)
Sends a message to an Objective-C object. |
Object |
send(String receiver,
String selector,
Object... args)
Sends a message to an Objective-C object. |
com.sun.jna.Pointer |
sendPointer(com.sun.jna.Pointer receiver,
com.sun.jna.Pointer selector,
Object... args)
A wrapper around send() to ensure that a pointer is returned from the message. |
com.sun.jna.Pointer |
sendPointer(com.sun.jna.Pointer receiver,
String selector,
Object... args)
A wrapper around send() to ensure that a pointer is returned from the message. |
com.sun.jna.Pointer |
sendPointer(String receiver,
com.sun.jna.Pointer selector,
Object... args)
A wrapper around send() to ensure that a pointer is returned from the message. |
com.sun.jna.Pointer |
sendPointer(String receiver,
String selector,
Object... args)
A wrapper around send() to ensure that a pointer is returned from the message. |
Proxy |
sendProxy(com.sun.jna.Pointer receiver,
com.sun.jna.Pointer selector,
Object... args)
A wrapper around send() to ensure that a Proxy object is returned from the message. |
Proxy |
sendProxy(com.sun.jna.Pointer receiver,
String selector,
Object... args)
A wrapper around send() to ensure that a Proxy object is returned from the message. |
Proxy |
sendProxy(String receiver,
com.sun.jna.Pointer selector,
Object... args)
A wrapper around send() to ensure that a Proxy object is returned from the message. |
Proxy |
sendProxy(String receiver,
String selector,
Object... args)
A wrapper around send() to ensure that a Proxy object is returned from the message. |
Client |
setCoerceInputs(boolean coerceInputs)
Set the coerceInputs flag. |
Client |
setCoerceOutputs(boolean coerceOutputs)
Sets the coerceOutputs flag. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Client()
| Method Detail |
|---|
public static Client getInstance()
public static Client getRawClient()
public Client setCoerceInputs(boolean coerceInputs)
coerceInputs - Whether to coerce inputs to messages.
TypeMapper,
TypeMappingpublic Client setCoerceOutputs(boolean coerceOutputs)
coerceOutputs - Whether to coerce the outputs of messages.
TypeMapper,
TypeMappingpublic boolean getCoerceInputs()
TypeMapper,
TypeMappingpublic boolean getCoerceOutputs()
TypeMapper,
TypeMapping
public Object send(com.sun.jna.Pointer receiver,
com.sun.jna.Pointer selector,
Object... args)
String hello = (String)Client.getInstance()
.send(cls("NSString"), sel("stringWithUTF8String:"), "Hello");
receiver - A pointer to the object to which the message is being sent.selector - A pointer to the selector to call on the target.args - Variable arguments of the message.
public Object send(com.sun.jna.Pointer receiver,
String selector,
Object... args)
String hello = (String)Client.getInstance()
.send(cls("NSString"), "stringWithUTF8String:", "Hello");
receiver - A pointer to the object to which the message is being sent.selector - The string selector. (E.g. "addObject:atIndex:")args - Variable arguments of the message.
public Object send(String receiver,
com.sun.jna.Pointer selector,
Object... args)
String hello = (String)Client.getInstance()
.send("NSString", sel("stringWithUTF8String:"), "Hello");
receiver - The name of a class to send the message to.selector - Pointer to the selector.args - Variable arguments of the message.
public Object send(String receiver,
String selector,
Object... args)
String hello = (String)Client.getInstance()
.send("NSString", "stringWithUTF8String:", "Hello");
receiver - The name of a class to send the message to.selector - Pointer to the selector.args - Variable arguments of the message.
public Object send(Peerable proxy,
com.sun.jna.Pointer selector,
Object... args)
Proxy array = Client.getInstance().sendProxy("NSMutableArray", sel("array"));
String hello = (String)Client
.getInstance().send(array, sel("addObject:atIndex"), "Hello", 2);
receiver - The object to which we are sending the message.selector - Pointer to the selector.args - Variable arguments of the message.
public Object send(Peerable proxy,
String selector,
Object... args)
Proxy array = Client.getInstance().sendProxy("NSMutableArray", "array");
String hello = (String)Client
.getInstance().send(array, "addObject:atIndex", "Hello", 2);
receiver - The object to which we are sending the message.selector - Pointer to the selector.args - Variable arguments of the message.
public com.sun.jna.Pointer sendPointer(com.sun.jna.Pointer receiver,
com.sun.jna.Pointer selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public com.sun.jna.Pointer sendPointer(com.sun.jna.Pointer receiver,
String selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public com.sun.jna.Pointer sendPointer(String receiver,
com.sun.jna.Pointer selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public com.sun.jna.Pointer sendPointer(String receiver,
String selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public Proxy sendProxy(com.sun.jna.Pointer receiver,
com.sun.jna.Pointer selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public Proxy sendProxy(String receiver,
com.sun.jna.Pointer selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public Proxy sendProxy(String receiver,
String selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public Proxy sendProxy(com.sun.jna.Pointer receiver,
String selector,
Object... args)
receiver - The object to which the message is being sent.selector - The selector to call on the receiver.args - Variable arguments to the message.
public Proxy chain(String cls,
com.sun.jna.Pointer selector,
Object... args)
public Proxy chain(String cls,
String selector,
Object... args)
cls - selector - args -
public PeerableRecipient newObject(Class<? extends PeerableRecipient> cls)
cls - The class of the instance that should be created.
public Object send(Message... messages)
messages -
public Message[] buildMessageChain(Object... parameters)
parameters -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||