Mac Developer Library

Developer

WebKit Framework Reference WebJavaPlugIn Protocol Reference

Options
Deployment Target:

On This Page
Language:

WebJavaPlugIn

Inheritance


Not Applicable

Conforms To


Not Applicable

Import Statement


Not Applicable

Objective-C

@import WebKit;

Availability


Available in OS X v10.3.9 and later.

The WebJavaPlugIn protocol provides methods to facilitate JNI access to the Java virtual machine via the plug-in.

  • Sends a message directly to a Java object in a plug-in.

    Declaration

    Objective-C

    - (jvalue)webPlugInCallJava:(jobject)object isStatic:(BOOL)isStatic returnType:(WebJNIReturnType)returnType method:(jmethodID)method arguments:(jvalue *)args callingURL:(NSURL *)url exceptionDescription:(NSString **)exceptionString

    Parameters

    object

    The Java instance receiving the message.

    isStatic

    If YEStrue, method is expected to be a class method.

    returnType

    The return type of the Java method.

    method

    The Java method being called.

    args

    The arguments for the method specified by method.

    url

    The URL for the page that contains the JavaScript that is interacting with Java.

    exceptionString

    A string for describing any exceptions thrown by Java. Pass nil if you do not want an exception description.

    Return Value

    The return value of the Java method.

    Discussion

    This method is preferred over using JNI to send messages to Java applets, and is required to guarantee the correct thread will receive the message. Always invoke this method from within the main thread.

    Import Statement

    Objective-C

    @import WebKit;

    Availability

    Available in OS X v10.3.9 and later.

  • Returns a jobject that represents a Java applet in a WebPlugInContainer.

    Declaration

    Objective-C

    - (jobject)webPlugInGetApplet

    Return Value

    A jobject that represents the applet.

    Discussion

    Always invoke this method from within the main thread.

    Import Statement

    Objective-C

    @import WebKit;

    Availability

    Available in OS X v10.3.9 and later.

  • The return type of the Java method.

    Declaration

    Objective-C

    typedef enum { WebJNIReturnTypeInvalid = 0, WebJNIReturnTypeVoid, WebJNIReturnTypeObject, WebJNIReturnTypeBoolean, WebJNIReturnTypeByte, WebJNIReturnTypeChar, WebJNIReturnTypeShort, WebJNIReturnTypeInt, WebJNIReturnTypeLong, WebJNIReturnTypeFloat, WebJNIReturnTypeDouble } WebJNIReturnType;

    Constants

    • WebJNIReturnTypeInvalid

      WebJNIReturnTypeInvalid

      The return type is invalid.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeVoid

      WebJNIReturnTypeVoid

      The return type is void.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeObject

      WebJNIReturnTypeObject

      The return type is an object.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeBoolean

      WebJNIReturnTypeBoolean

      The return type is a Boolean value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeByte

      WebJNIReturnTypeByte

      The return type is a byte value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeChar

      WebJNIReturnTypeChar

      The return type is a char value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeShort

      WebJNIReturnTypeShort

      The return type is a short value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeInt

      WebJNIReturnTypeInt

      The return type is an int value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeLong

      WebJNIReturnTypeLong

      The return type is a long value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeFloat

      WebJNIReturnTypeFloat

      The return type is a float value.

      Available in OS X v10.3 through OS X v10.8.

    • WebJNIReturnTypeDouble

      WebJNIReturnTypeDouble

      The return type is a double value.

      Available in OS X v10.3 through OS X v10.8.

    Import Statement

    Objective-C

    @import WebKit;

    Availability

    Available in OS X v10.3 through OS X v10.8.