com.jniwrapper.win32.automation
Class Automation

java.lang.Object
  extended bycom.jniwrapper.win32.automation.Automation

public class Automation
extends java.lang.Object

Provides functions to invoke property setters, getters or interface methods using features of standard IDispatch interface. By default it uses the OleMessageLoop thread to perform automation in it. If you need to perform automation in the current thread, use an appropriate constructor. Note: Invoke the release method after using the Automation object.


Nested Class Summary
 class Automation.InvocationHelper
           
 
Field Summary
static LocaleID DEFAULT_LOCALE_ID
          Defines default locale ID for all automation function calls.
 
Constructor Summary
Automation(IDispatch dispatch)
          Creates an Automation instance for a given IDispatch interface.
Automation(IDispatch dispatch, boolean useCurrentThread)
          Creates an Automation instance for a given IDispatch interface.
Automation(IUnknown unknown)
          Creates an Automation instance for a given IUnknown interface.
Automation(IUnknown unknown, boolean useCurrentThread)
          Creates an Automation instance for a given IUnknown interface.
 
Method Summary
static Variant asVariant(java.lang.Object value)
          Converts a java/JNIWrapper object to the Variant parameter.
static java.lang.Object getDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Class returnValueClass)
          Returns dispatch property.
static java.lang.Object getDispatchProperty(IDispatch dispatch, java.lang.String propertyName, int index, java.lang.Class implClass)
          Returns indexed dispatch property.
static java.lang.Object getDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object[] indexes, java.lang.Class returnValueClass)
          Returns indexed dispatch property.
static java.lang.Object getDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object index, java.lang.Class returnValueClass)
          Returns indexed dispatch property.
static java.lang.Object getDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object index1, java.lang.Object index2, java.lang.Class returnValueClass)
          Returns indexed dispatch property.
static java.lang.Object getDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object index1, java.lang.Object index2, java.lang.Object index3, java.lang.Class returnValueClass)
          Returns indexed dispatch property.
 DispID getDispID(java.lang.String propertyName)
          Returns DispID of property or method
 LocaleID getLocaleID()
          Returns locale ID.
 Variant getProperty(DispID dispid)
          Returns property value of a referenced interface.
 Variant getProperty(DispID dispID, int index)
          Returns the value of the specified collection property by the index.
 Variant getProperty(DispID dispID, java.lang.Object index)
          Returns the value of the specified collection property by the name.
 Variant getProperty(DispID dispID, java.lang.Object[] indexes)
          Returns the value of the specified collection property by the name.
 Variant getProperty(DispID dispID, Variant index)
          Returns the value of the specified collection property by the name.
 Variant getProperty(DispID dispID, Variant[] indexes)
          Returns the value of the specified collection property by the name.
 Variant getProperty(java.lang.String propertyName)
          Returns property value of a referenced interface.
 Variant getProperty(java.lang.String propertyName, int index)
          Returns the value of the specified collection property by the index.
 Variant getProperty(java.lang.String propertyName, java.lang.Object index)
          Returns the value of the specified collection property by the name.
 Variant getProperty(java.lang.String propertyName, java.lang.Object[] indexes)
          Returns the value of the specified collection property by the name.
 Variant getProperty(java.lang.String propertyName, Variant index)
          Returns the value of the specified collection property by the name.
 Variant getProperty(java.lang.String propertyName, Variant[] indexes)
          Returns the value of the specified collection property by the name.
 Variant invoke(DispID dispID)
          Invokes the method of a referenced interface.
 Variant invoke(DispID dispID, java.lang.Object parameter)
          Helper method that invokes the method of a referenced interface with one parameter.
 Variant invoke(DispID dispID, java.lang.Object parameter1, java.lang.Object parameter2)
          Helper method that invokes the method of a referenced interface with two parameters.
 Variant invoke(DispID dispID, java.lang.Object parameter1, java.lang.Object parameter2, java.lang.Object parameter3)
          Helper method that invokes the method of a referenced interface with three parameters.
 Variant invoke(DispID dispID, Variant parameter)
          Helper method that invokes the method of a referenced interface with one Variant parameter.
 Variant invoke(DispID dispID, Variant[] parameters)
          Invokes the method of a referenced interface.
 Variant invoke(DispID dispID, Variant parameter1, Variant parameter2)
          Helper method that invokes the method of a referenced interface with two Variant parameters.
 Variant invoke(DispID dispID, Variant parameter1, Variant parameter2, Variant parameter3)
          Helper method that invokes the method of a referenced interface with three Variant parameters.
 Variant invoke(java.lang.String methodName)
          Invokes the method of a referenced interface.
 Variant invoke(java.lang.String methodName, java.lang.Object parameter)
          Helper method that invokes the method of a referenced interface with one parameter.
 Variant invoke(java.lang.String methodName, java.lang.Object[] parameters)
          Invokes the method of a referenced interface.
 Variant invoke(java.lang.String methodName, java.lang.Object parameter1, java.lang.Object parameter2)
          Helper method that invokes the method of a referenced interface with two parameters.
 Variant invoke(java.lang.String methodName, java.lang.Object parameter1, java.lang.Object parameter2, java.lang.Object parameter3)
          Helper method that invokes the method of a referenced interface with three parameters.
 Variant invoke(java.lang.String methodName, Variant parameter)
          Helper method that invokes the method of a referenced interface with one Variant parameter.
 Variant invoke(java.lang.String methodName, Variant[] parameters)
          Invokes the method of a referenced interface.
 Variant invoke(java.lang.String methodName, Variant parameter1, Variant parameter2)
          Helper method that invokes the method of a referenced interface with two Variant parameters.
 Variant invoke(java.lang.String methodName, Variant parameter1, Variant parameter2, Variant parameter3)
          Helper method that invokes the method of a referenced interface with three Variant parameters.
static Variant invokeDispatch(IDispatch dispatch, DispID dispID, DispParams dispParams)
          Deprecated. use invokeDispatch(IDispatch dispatch, DispID dispID, Parameter[] args) instead
static java.lang.Object invokeDispatch(IDispatch dispatch, DispID dispID, DispParams dispParams, java.lang.Class returnValueClass)
          Deprecated. use invokeDispatch(IDispatch dispatch, DispID dispID, Parameter[] args, Class returnValueClass) instead
static java.lang.Object invokeDispatch(IDispatch dispatch, java.lang.String methodName, Parameter[] args, java.lang.Class returnValueClass)
          Invokes the method through dispatch interface reference.
 boolean isDispInterface()
          Returns the value of DispInterface property.
 boolean isUseCurrentThread()
          Returns true if the automation is performed in the current thread; false - if in the OleMessageLoop thread.
 void release()
          Releases dispatch encapsulated in this object.
static void setDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object value)
          Sets dispatch property.
static void setDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object[] values)
          Sets dispatch property.
static void setDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object value1, java.lang.Object value2)
          Sets dispatch property.
static void setDispatchProperty(IDispatch dispatch, java.lang.String propertyName, java.lang.Object value1, java.lang.Object value2, java.lang.Object value3)
          Sets dispatch property.
 void setDispInterface(boolean dispInterface)
          Specifies the value of DispInterface property.
 void setLocaleID(LocaleID localeID)
          Set locale ID.
 void setProperty(DispID dispID, java.lang.Object value)
          Sets property value of a referenced interface.
 void setProperty(DispID dispID, java.lang.Object[] values)
          Sets property value of a referenced interface.
 void setProperty(DispID dispID, Variant value)
          Sets property value of a referenced interface.
 void setProperty(java.lang.String propertyName, java.lang.Object value)
          Sets property value of a referenced interface.
 void setProperty(java.lang.String propertyName, java.lang.Object[] values)
          Sets property value of a referenced interface.
 void setProperty(java.lang.String propertyName, Variant value)
          Sets property value of a referenced interface.
 void setProperty(java.lang.String propertyName, Variant[] args)
          Sets property value of a referenced interface.
 void setUseCurrentThread(boolean useCurrentThread)
          Specifies where to perform automation.
static Variant[] toVariantArray(java.lang.Object[] parameters)
          Converts an array of java/JNIWrapper objects to the array of Variants.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LOCALE_ID

public static LocaleID DEFAULT_LOCALE_ID
Defines default locale ID for all automation function calls.
Use -Dteamdev.comfyj.automation.localeID={value} VM parameter to modify locale ID at startup.

Constructor Detail

Automation

public Automation(IUnknown unknown,
                  boolean useCurrentThread)
Creates an Automation instance for a given IUnknown interface.

Parameters:
unknown - object to automate.
useCurrentThread - specifies where to perform automation. If true, the automation will be performed in the current thread, if false -in the OleMessageLoop thread.

Automation

public Automation(IUnknown unknown)
Creates an Automation instance for a given IUnknown interface. The automation will be performed in the OleMessageLoop thread. In order to perform automation in the current thread, use the Automation(com.jniwrapper.win32.com.IUnknown, boolean) constructor.

Parameters:
unknown - object to automate.

Automation

public Automation(IDispatch dispatch,
                  boolean useCurrentThread)
Creates an Automation instance for a given IDispatch interface.

Parameters:
dispatch - object to automate.
useCurrentThread - specifies where to perform automation. If true, the automation will be performed in the current thread, if false -in the OleMessageLoop thread.

Automation

public Automation(IDispatch dispatch)
Creates an Automation instance for a given IDispatch interface. The automation will be performed in the OleMessageLoop thread by default.
In order to perform automation in the current thread, use the Automation(com.jniwrapper.win32.com.IUnknown, boolean) constructor.

Parameters:
dispatch - object to automate.
Method Detail

isDispInterface

public boolean isDispInterface()
Returns the value of DispInterface property. This property determines the order of parameters during method invocation.

Returns:
DispInterface property value

setDispInterface

public void setDispInterface(boolean dispInterface)
Specifies the value of DispInterface property. This property determines the order of parameters during method invocation.

Parameters:
dispInterface - DispInterface flag

isUseCurrentThread

public boolean isUseCurrentThread()
Returns true if the automation is performed in the current thread; false - if in the OleMessageLoop thread.

Returns:
true, if the automation is performed in the current thread; false - if in the OleMessageLoop thread.

setUseCurrentThread

public void setUseCurrentThread(boolean useCurrentThread)
Specifies where to perform automation.

Parameters:
useCurrentThread - if true, the current thread will be used; if false OleMessageLoop thread.

getDispID

public DispID getDispID(java.lang.String propertyName)
Returns DispID of property or method

Parameters:
propertyName - name of the property
Returns:
DispID

getProperty

public Variant getProperty(DispID dispid)
                    throws ComException
Returns property value of a referenced interface.

Parameters:
dispid - object's property ID.
Returns:
property value as Variant.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(java.lang.String propertyName)
                    throws ComException
Returns property value of a referenced interface.

Parameters:
propertyName - object's property name.
Returns:
property value as Variant.
Throws:
ComException - when the property getting is failed

getDispatchProperty

public static java.lang.Object getDispatchProperty(IDispatch dispatch,
                                                   java.lang.String propertyName,
                                                   java.lang.Class returnValueClass)
Returns dispatch property.

Parameters:
dispatch - dispatch interface reference
propertyName - property name
returnValueClass - expected type of return value
Returns:
dispatch property of returnValueClass type

getDispatchProperty

public static java.lang.Object getDispatchProperty(IDispatch dispatch,
                                                   java.lang.String propertyName,
                                                   java.lang.Object index,
                                                   java.lang.Class returnValueClass)
Returns indexed dispatch property.

Parameters:
dispatch - dispatch interface reference
propertyName - property name
index - index of property
returnValueClass - expected type of return value
Returns:
dispatch property of returnValueClass type

getDispatchProperty

public static java.lang.Object getDispatchProperty(IDispatch dispatch,
                                                   java.lang.String propertyName,
                                                   java.lang.Object index1,
                                                   java.lang.Object index2,
                                                   java.lang.Class returnValueClass)
Returns indexed dispatch property.

Parameters:
dispatch - dispatch interface reference
propertyName - property name
index1 - index of property
index2 - index of property
returnValueClass - expected type of return value
Returns:
dispatch property of returnValueClass type

getDispatchProperty

public static java.lang.Object getDispatchProperty(IDispatch dispatch,
                                                   java.lang.String propertyName,
                                                   java.lang.Object index1,
                                                   java.lang.Object index2,
                                                   java.lang.Object index3,
                                                   java.lang.Class returnValueClass)
Returns indexed dispatch property.

Parameters:
dispatch - dispatch interface reference
propertyName - property name
index1 - index of property
index2 - index of property
index3 - index of property
returnValueClass - expected type of return value
Returns:
dispatch property of returnValueClass type

getDispatchProperty

public static java.lang.Object getDispatchProperty(IDispatch dispatch,
                                                   java.lang.String propertyName,
                                                   java.lang.Object[] indexes,
                                                   java.lang.Class returnValueClass)
Returns indexed dispatch property.

Parameters:
dispatch - dispatch interface reference
propertyName - property name
indexes - index of property
returnValueClass - expected type of return value
Returns:
dispatch property of returnValueClass type

getDispatchProperty

public static java.lang.Object getDispatchProperty(IDispatch dispatch,
                                                   java.lang.String propertyName,
                                                   int index,
                                                   java.lang.Class implClass)
Returns indexed dispatch property.

Parameters:
dispatch - dispatch interface reference
propertyName - property name
index - index of property
implClass - expected type of return value
Returns:
dispatch property of implClass type

getProperty

public Variant getProperty(java.lang.String propertyName,
                           int index)
                    throws ComException
Returns the value of the specified collection property by the index.

Parameters:
propertyName - collection property name.
index - index of the collection item.
Returns:
collection item.
Throws:
ComException - when the property setting is failed

getProperty

public Variant getProperty(DispID dispID,
                           int index)
                    throws ComException
Returns the value of the specified collection property by the index.

Parameters:
dispID - collection property id.
index - index of the collection item.
Returns:
collection item.
Throws:
ComException - when the property setting is failed

getProperty

public Variant getProperty(java.lang.String propertyName,
                           java.lang.Object index)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
propertyName - collection property name.
index - name of the collection item.
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(DispID dispID,
                           java.lang.Object index)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
dispID - collection property id.
index - name of the collection item.
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(java.lang.String propertyName,
                           Variant index)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
propertyName - collection property name.
index - name of the collection item.
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(DispID dispID,
                           Variant index)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
dispID - collection property id.
index - name of the collection item.
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(java.lang.String propertyName,
                           java.lang.Object[] indexes)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
propertyName - collection property name.
indexes - array of indices
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(DispID dispID,
                           java.lang.Object[] indexes)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
dispID - collection property id.
indexes - array of indices
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(java.lang.String propertyName,
                           Variant[] indexes)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
propertyName - collection property name.
indexes - array of indices
Returns:
collection item.
Throws:
ComException - when the property getting is failed

getProperty

public Variant getProperty(DispID dispID,
                           Variant[] indexes)
                    throws ComException
Returns the value of the specified collection property by the name.

Parameters:
dispID - collection property id.
indexes - array of indices
Returns:
collection item.
Throws:
ComException - when the property getting is failed

setProperty

public void setProperty(java.lang.String propertyName,
                        Variant value)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
propertyName - object's property name.
value - a new property value.
Throws:
ComException - when the property setting is failed

setProperty

public void setProperty(DispID dispID,
                        Variant value)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
dispID - object's property id.
value - a new property value.
Throws:
ComException - when the property setting is failed

setProperty

public void setProperty(java.lang.String propertyName,
                        Variant[] args)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
propertyName - object's property name.
args - property args
Throws:
ComException - when the property setting is failed

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object value)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
propertyName - object's property name.
value - property value
Throws:
ComException - when the property setting is failed

setProperty

public void setProperty(DispID dispID,
                        java.lang.Object value)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
dispID - object's property ID.
value - property value
Throws:
ComException - when the property setting is failed

setProperty

public void setProperty(java.lang.String propertyName,
                        java.lang.Object[] values)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
propertyName - object's property name.
values - property values
Throws:
ComException - when the property setting is failed

setProperty

public void setProperty(DispID dispID,
                        java.lang.Object[] values)
                 throws ComException
Sets property value of a referenced interface.

Parameters:
dispID - object's property ID.
values - property values
Throws:
ComException - when the property setting is failed

setDispatchProperty

public static void setDispatchProperty(IDispatch dispatch,
                                       java.lang.String propertyName,
                                       java.lang.Object value)
Sets dispatch property.

Parameters:
dispatch - dispatch instance
propertyName - property name
value - property value

setDispatchProperty

public static void setDispatchProperty(IDispatch dispatch,
                                       java.lang.String propertyName,
                                       java.lang.Object value1,
                                       java.lang.Object value2)
Sets dispatch property.

Parameters:
dispatch - dispatch instance
propertyName - property name
value1 - property value
value2 - property value

setDispatchProperty

public static void setDispatchProperty(IDispatch dispatch,
                                       java.lang.String propertyName,
                                       java.lang.Object value1,
                                       java.lang.Object value2,
                                       java.lang.Object value3)
Sets dispatch property.

Parameters:
dispatch - dispatch instance
propertyName - property name
value1 - property value
value2 - property value
value3 - property value

setDispatchProperty

public static void setDispatchProperty(IDispatch dispatch,
                                       java.lang.String propertyName,
                                       java.lang.Object[] values)
Sets dispatch property.

Parameters:
dispatch - dispatch instance
propertyName - property name
values - property value

invoke

public Variant invoke(java.lang.String methodName)
               throws ComException
Invokes the method of a referenced interface.

Parameters:
methodName - object's method name.
Returns:
result of method invocation.
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID)
               throws ComException
Invokes the method of a referenced interface.

Parameters:
dispID - object's method name.
Returns:
result of method invocation.
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      java.lang.Object parameter)
               throws ComException
Helper method that invokes the method of a referenced interface with one parameter.

Parameters:
methodName - object's method name.
parameter - method parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      java.lang.Object parameter)
               throws ComException
Helper method that invokes the method of a referenced interface with one parameter.

Parameters:
dispID - object's method name.
parameter - method parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      Variant parameter)
               throws ComException
Helper method that invokes the method of a referenced interface with one Variant parameter.

Parameters:
methodName - object's method name.
parameter - method parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      Variant parameter)
               throws ComException
Helper method that invokes the method of a referenced interface with one Variant parameter.

Parameters:
dispID - object's method name.
parameter - method parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      java.lang.Object parameter1,
                      java.lang.Object parameter2)
               throws ComException
Helper method that invokes the method of a referenced interface with two parameters.

Parameters:
methodName - object's method name.
parameter1 - first parameter
parameter2 - second parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      java.lang.Object parameter1,
                      java.lang.Object parameter2)
               throws ComException
Helper method that invokes the method of a referenced interface with two parameters.

Parameters:
dispID - object's method ID.
parameter1 - first parameter
parameter2 - second parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      Variant parameter1,
                      Variant parameter2)
               throws ComException
Helper method that invokes the method of a referenced interface with two Variant parameters.

Parameters:
methodName - object's method name.
parameter1 - first parameter
parameter2 - second parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      Variant parameter1,
                      Variant parameter2)
               throws ComException
Helper method that invokes the method of a referenced interface with two Variant parameters.

Parameters:
dispID - object's method ID.
parameter1 - first parameter
parameter2 - second parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      java.lang.Object parameter1,
                      java.lang.Object parameter2,
                      java.lang.Object parameter3)
               throws ComException
Helper method that invokes the method of a referenced interface with three parameters.

Parameters:
methodName - object's method name.
parameter1 - first parameter
parameter2 - second parameter
parameter3 - third parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      java.lang.Object parameter1,
                      java.lang.Object parameter2,
                      java.lang.Object parameter3)
               throws ComException
Helper method that invokes the method of a referenced interface with three parameters.

Parameters:
dispID - object's method name.
parameter1 - first parameter
parameter2 - second parameter
parameter3 - third parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      Variant parameter1,
                      Variant parameter2,
                      Variant parameter3)
               throws ComException
Helper method that invokes the method of a referenced interface with three Variant parameters.

Parameters:
methodName - object's method name.
parameter1 - first parameter
parameter2 - second parameter
parameter3 - third parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      Variant parameter1,
                      Variant parameter2,
                      Variant parameter3)
               throws ComException
Helper method that invokes the method of a referenced interface with three Variant parameters.

Parameters:
dispID - object's method ID.
parameter1 - first parameter
parameter2 - second parameter
parameter3 - third parameter
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      Variant[] parameters)
               throws ComException
Invokes the method of a referenced interface.

Parameters:
methodName - object's method name.
parameters - an array of parameter; each element of the array should be a variant.
Returns:
result of method invocation.
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(DispID dispID,
                      Variant[] parameters)
               throws ComException
Invokes the method of a referenced interface.

Parameters:
dispID - object's method ID.
parameters - an array of parameter; each element of the array should be a variant.
Returns:
result of method invocation.
Throws:
ComException - when the method invocation is failed

invoke

public Variant invoke(java.lang.String methodName,
                      java.lang.Object[] parameters)
               throws ComException
Invokes the method of a referenced interface.

Parameters:
methodName - method name
parameters - each element of parameters array can be one of java or JNIWrapper type.
Returns:
result of invocation mathod.
Throws:
ComException - when the method invocation is failed

toVariantArray

public static Variant[] toVariantArray(java.lang.Object[] parameters)
Converts an array of java/JNIWrapper objects to the array of Variants.

Parameters:
parameters - an array of java/JNIWrapper objects.
Returns:
an array of Variants.

asVariant

public static Variant asVariant(java.lang.Object value)
Converts a java/JNIWrapper object to the Variant parameter.

Parameters:
value - an object for conversion.
Returns:
a variant for a given value.

invokeDispatch

public static java.lang.Object invokeDispatch(IDispatch dispatch,
                                              java.lang.String methodName,
                                              Parameter[] args,
                                              java.lang.Class returnValueClass)
Invokes the method through dispatch interface reference.

Parameters:
dispatch - dispatch interface reference
methodName - dispid of the invoked method
args - array of arguments
returnValueClass - return value type
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invokeDispatch

public static Variant invokeDispatch(IDispatch dispatch,
                                     DispID dispID,
                                     DispParams dispParams)
Deprecated. use invokeDispatch(IDispatch dispatch, DispID dispID, Parameter[] args) instead

Invokes the method through dispatch interface reference.

Parameters:
dispatch - dispatch interface reference
dispID - dispid of the invoked method
dispParams - an array of parameter for Dispatch.invoke() call
Returns:
result of method invocation
Throws:
ComException - when the method invocation is failed

invokeDispatch

public static java.lang.Object invokeDispatch(IDispatch dispatch,
                                              DispID dispID,
                                              DispParams dispParams,
                                              java.lang.Class returnValueClass)
Deprecated. use invokeDispatch(IDispatch dispatch, DispID dispID, Parameter[] args, Class returnValueClass) instead

Invokes the method through dispatch interface reference.

Parameters:
dispatch - dispatch interface reference
dispID - dispid of the invoked method
dispParams - an array of parameter for Dispatch.invoke() call
returnValueClass - expected type for return value
Returns:
result of method invocation of returnValueClass type
Throws:
ComException - when the method invocation is failed

release

public void release()
Releases dispatch encapsulated in this object.


getLocaleID

public LocaleID getLocaleID()
Returns locale ID.

Returns:
locale ID

setLocaleID

public void setLocaleID(LocaleID localeID)
Set locale ID.

Parameters:
localeID - locale ID