org.jinterop.dcom.common
Class JIInterfaceDefinition

java.lang.Object
  extended by org.jinterop.dcom.common.JIInterfaceDefinition
All Implemented Interfaces:
java.io.Serializable

public final class JIInterfaceDefinition
extends java.lang.Object
implements java.io.Serializable

Forms the definition of a Java Interface. Please note that Overloads not allowed. Primarily used to form a definition for callback.


Please refer to MSInternetExplorer example for more details on how to use this class.

Since:
1.0
See Also:
Serialized Form

Constructor Summary
JIInterfaceDefinition(java.lang.String interfaceIdentifier)
          Creates an Interface definition.
JIInterfaceDefinition(java.lang.String interfaceIdentifier, boolean isDispInterface)
          Creates an Interface definition.
 
Method Summary
 void addMethodDescriptor(JIMethodDescriptor methodDescriptor)
          Adds a Method Descriptor.
 java.lang.String getInterfaceIdentifier()
          Returns the interface identifier of this definition.
 JIMethodDescriptor getMethodDescriptor(int opnum)
          Returns the descriptor identified by it's Method number.
 JIMethodDescriptor getMethodDescriptor(java.lang.String name)
          Returns the descriptor identified by it's Method Name.
 JIMethodDescriptor getMethodDescriptorForDispId(int dispId)
          Returns the descriptor identified by it's dispId.
 JIMethodDescriptor[] getMethodDescriptors()
          Returns all descriptors.
 boolean isDispInterface()
          Returns whether this interface supports IDispatch or not.
 void removeMethodDescriptor(int opnum)
          Removes the descriptor identified by it's Method Num.
 void removeMethodDescriptor(java.lang.String methodName)
          Removes the descriptor identified by it's Method Name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JIInterfaceDefinition

public JIInterfaceDefinition(java.lang.String interfaceIdentifier)
Creates an Interface definition. By default, the "dispinterface" property is true.

Parameters:
interfaceIdentifier -

JIInterfaceDefinition

public JIInterfaceDefinition(java.lang.String interfaceIdentifier,
                             boolean isDispInterface)
Creates an Interface definition. Set isDispInterface interface to false if this interface does not support IDispatch based calls.

Parameters:
interfaceIdentifier -
isDispInterface - true if IDispatch is supported ("dispinterface"), false otherwise
Method Detail

addMethodDescriptor

public void addMethodDescriptor(JIMethodDescriptor methodDescriptor)
Adds a Method Descriptor. Methods should be added in the same order as they appear in the IDL.

Please note that overloaded Methods are not allowed.

Parameters:
methodDescriptor -

getMethodDescriptor

public JIMethodDescriptor getMethodDescriptor(int opnum)
Returns the descriptor identified by it's Method number.

Parameters:
opnum -
Returns:

getMethodDescriptorForDispId

public JIMethodDescriptor getMethodDescriptorForDispId(int dispId)
Returns the descriptor identified by it's dispId.

Parameters:
dispId -
Returns:

getMethodDescriptor

public JIMethodDescriptor getMethodDescriptor(java.lang.String name)
Returns the descriptor identified by it's Method Name.

Parameters:
name -
Returns:

getMethodDescriptors

public JIMethodDescriptor[] getMethodDescriptors()
Returns all descriptors.

Returns:

getInterfaceIdentifier

public java.lang.String getInterfaceIdentifier()
Returns the interface identifier of this definition.

Returns:

removeMethodDescriptor

public void removeMethodDescriptor(int opnum)
Removes the descriptor identified by it's Method Num.

Please note that removal of a sequential Method Num can have unpredictable results during a call.

Parameters:
opnum -

removeMethodDescriptor

public void removeMethodDescriptor(java.lang.String methodName)
Removes the descriptor identified by it's Method Name.

Please note that removal of a sequential Method Num can have unpredictable results during a call.

Parameters:
methodName -

isDispInterface

public boolean isDispInterface()
Returns whether this interface supports IDispatch or not.

Returns:
true if IDispatch is supported.