org.jinterop.dcom.core
Class JIVariant

java.lang.Object
  extended by org.jinterop.dcom.core.JIVariant
All Implemented Interfaces:
java.io.Serializable

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

Class representing the VARIANT datatype.

Please use the byRef flag based constructors for by reference parameters in COM calls. For [optional] parameters use the OPTIONAL_PARAM()

In case of direct calls to COM server using JICallBuilder, if the byRef flag is set then that variant should also be added as the [out] parameter in the JICallBuilder. For developers using the IJIDispatch this is not required and variant would be returned back to them via JIVariant[] associated with IJIDispatch apis.

An important note for Boolean Arrays (JIArray of Boolean), please set the JIFlag.FLAG_REPRESENTATION_VARIANT_BOOL using the setFlag(int) method before making a call on this object. This is required since in DCOM , VARIANT_BOOL are 2 bytes and standard booleans are 1 byte in length.

Since:
1.0
See Also:
Serialized Form

Field Summary
static int FADF_AUTO
           
static int FADF_BSTR
           
static int FADF_DISPATCH
           
static int FADF_EMBEDDED
           
static int FADF_FIXEDSIZE
           
static int FADF_HAVEIID
           
static int FADF_HAVEVARTYPE
           
static int FADF_RECORD
           
static int FADF_RESERVED
           
static int FADF_STATIC
           
static int FADF_UNKNOWN
           
static int FADF_VARIANT
           
static org.jinterop.dcom.core.JIVariant.SCODE SCODE
          SCODE VARIANT
static int VT_ARRAY
           
static int VT_BOOL
           
static int VT_BSTR
           
static int VT_BYREF
           
static int VT_BYREF_VT_ARRAY
           
static int VT_BYREF_VT_BOOL
           
static int VT_BYREF_VT_BSTR
           
static int VT_BYREF_VT_CY
           
static int VT_BYREF_VT_DATE
           
static int VT_BYREF_VT_DECIMAL
           
static int VT_BYREF_VT_DISPATCH
           
static int VT_BYREF_VT_ERROR
           
static int VT_BYREF_VT_I1
           
static int VT_BYREF_VT_I2
           
static int VT_BYREF_VT_I4
           
static int VT_BYREF_VT_I8
           
static int VT_BYREF_VT_INT
           
static int VT_BYREF_VT_R4
           
static int VT_BYREF_VT_R8
           
static int VT_BYREF_VT_UI1
           
static int VT_BYREF_VT_UI2
           
static int VT_BYREF_VT_UI4
           
static int VT_BYREF_VT_UINT
           
static int VT_BYREF_VT_UNKNOWN
           
static int VT_BYREF_VT_VARIANT
           
static int VT_CY
           
static int VT_DATE
           
static int VT_DECIMAL
           
static int VT_DISPATCH
           
static int VT_EMPTY
           
static int VT_ERROR
           
static int VT_I1
           
static int VT_I2
           
static int VT_I4
           
static int VT_I8
           
static int VT_INT
           
static int VT_NULL
           
static int VT_R4
           
static int VT_R8
           
static int VT_UI1
           
static int VT_UI2
           
static int VT_UI4
           
static int VT_UINT
           
static int VT_UNKNOWN
           
static int VT_VARIANT
           
 
Constructor Summary
JIVariant(boolean value)
          Setting up a VARIANT with a boolean.
JIVariant(boolean value, boolean isByRef)
          Setting up a VARIANT with a boolean.
JIVariant(char value)
          Setting up a VARIANT with a char.
JIVariant(char value, boolean isByRef)
          Setting up a VARIANT with a char.
JIVariant(java.util.Date value)
          Setting up a VARIANT with an java.util.Date.
JIVariant(java.util.Date value, boolean isByRef)
          Setting up a VARIANT with an java.util.Date.
JIVariant(double value)
          Setting up a VARIANT with a double.
JIVariant(double value, boolean isByRef)
          Setting up a VARIANT with a double.
JIVariant(float value)
          Setting up a VARIANT with a float.
JIVariant(float value, boolean isByRef)
          Setting up a VARIANT with a float.
JIVariant(IJIComObject value)
          Setting up a VARIANT with an IJIComObject.
JIVariant(IJIComObject value, boolean isByRef)
          Setting up a VARIANT with an IJIComObject.
JIVariant(IJIUnsigned number)
          Setting up a VARIANT with a unsigned value.
JIVariant(IJIUnsigned number, boolean isByRef)
          Setting up a VARIANT with a unsigned value.
JIVariant(int value)
          Setting up a VARIANT with an int.
JIVariant(int value, boolean isByRef)
          Setting up a VARIANT with an int.
JIVariant(JIArray array)
          Setting up a VARIANT with a JIArray.
JIVariant(JIArray array, boolean isByRef)
          Setting up a VARIANT with a JIArray.
JIVariant(JIArray array, boolean isByRef, int FLAG)
          Setting up a VARIANT with a JIArray.
JIVariant(JIArray array, int FLAG)
          Setting up a VARIANT with a JIArray.
JIVariant(JICurrency value)
          Setting up a VARIANT with a JICurrency.
JIVariant(JICurrency value, boolean isByRef)
          Setting up a VARIANT with a JICurrency.
JIVariant(JIString value)
          Setting up a VARIANT with a JIString.
JIVariant(JIString value, boolean isByRef)
          Setting up a VARIANT with a JIString.
JIVariant(org.jinterop.dcom.core.JIVariant.SCODE value, int errorCode)
          Setting up a VARIANT with a SCODE value and it's errorCode.
JIVariant(org.jinterop.dcom.core.JIVariant.SCODE value, int errorCode, boolean isByRef)
          Setting up a VARIANT with a SCODE value and it's errorCode.
JIVariant(JIVariant variant)
          Setting up a VARIANT as reference to another.
JIVariant(long value, boolean isByRef)
          Setting up a VARIANT with a long.
JIVariant(short value)
          Setting up a VARIANT with a short.
JIVariant(short value, boolean isByRef)
          Setting up a VARIANT with a short.
JIVariant(java.lang.String value)
          Setting up a VARIANT with a String.
JIVariant(java.lang.String value, boolean isByRef)
          Setting up a VARIANT with a String.
 
Method Summary
static JIVariant BSTRARRAY()
          Helper method for creating an array of BSTRs , IDL signature [in, out] SAFEARRAY(BSTR) *p.
static JIVariant EMPTY_BYREF()
          EMPTY BYREF VARIANT.
static JIVariant EMPTY()
          EMPTY VARIANT.
 int getFlag()
          Returns the flag value for this variant.
 java.lang.Object getObject()
          Returns the contained object.
 JIArray getObjectAsArray()
          Retrieves the contained object as JIArray.
 boolean getObjectAsBoolean()
          Retrieves the contained object as boolean.
 char getObjectAsChar()
          Retrieves the contained object as char.
 IJIComObject getObjectAsComObject()
          Retrieves the contained object as IJIComObject.
 java.util.Date getObjectAsDate()
          Retrieves the contained object as java.util.Date.
 double getObjectAsDouble()
          Retrieves the contained object as double.
 float getObjectAsFloat()
          Retrieves the contained object as float.
 int getObjectAsInt()
          Retrieves the contained object as int.
 long getObjectAsLong()
          Retrieves the contained object as long, used when the expected type is VT_I8.
 int getObjectAsSCODE()
          Retrieves the contained objects errorCode.
 short getObjectAsShort()
          Retrieves the contained object as short.
 JIString getObjectAsString()
          Retrieves the contained object as JIString.
 java.lang.String getObjectAsString2()
          Retrieves the contained object as String.
 IJIUnsigned getObjectAsUnsigned()
          Retrieves the contained object as unsigned number.
 JIVariant getObjectAsVariant()
          Retrieves the contained object as JIVariant.
 int getType()
          Returns the referent as integer.
 boolean isArray()
           
 boolean isByRefFlagSet()
           
 boolean isNull()
          Returns whether this variant is a NULL variant.
static JIVariant makeVariant(java.lang.Object o)
          Returns a JIVariant (of the right type) based on the o.getClass()
static JIVariant makeVariant(java.lang.Object o, boolean isByRef)
          Returns a JIVariant (of the right type) based on the o.getClass()
static JIVariant NULL()
          NULL VARIANT .
static JIVariant OPTIONAL_PARAM()
          OPTIONAL PARAM.
static JIVariant OUT_IDISPATCH()
          VARIANT for ([out] IDispatch*).
static JIVariant OUT_IUNKNOWN()
          VARIANT for ([out] IUnknown*).
static JIVariant OUTPARAMforType(java.lang.Class c, boolean isArray)
           
 void setFlag(int FLAG)
          Sets a JIFlags value to be used while encoding (marshalling) this Variant.
 java.lang.String toString()
           
static JIVariant VARIANTARRAY()
          Helper method for creating an array of VARIANTs , IDL signature [in, out] SAFEARRAY(VARIANT) *p OR [in,out] VARIANT *pArray.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VT_NULL

public static final int VT_NULL
See Also:
Constant Field Values

VT_EMPTY

public static final int VT_EMPTY
See Also:
Constant Field Values

VT_I4

public static final int VT_I4
See Also:
Constant Field Values

VT_UI1

public static final int VT_UI1
See Also:
Constant Field Values

VT_I2

public static final int VT_I2
See Also:
Constant Field Values

VT_R4

public static final int VT_R4
See Also:
Constant Field Values

VT_R8

public static final int VT_R8
See Also:
Constant Field Values

VT_VARIANT

public static final int VT_VARIANT
See Also:
Constant Field Values

VT_BOOL

public static final int VT_BOOL
See Also:
Constant Field Values

VT_ERROR

public static final int VT_ERROR
See Also:
Constant Field Values

VT_CY

public static final int VT_CY
See Also:
Constant Field Values

VT_DATE

public static final int VT_DATE
See Also:
Constant Field Values

VT_BSTR

public static final int VT_BSTR
See Also:
Constant Field Values

VT_UNKNOWN

public static final int VT_UNKNOWN
See Also:
Constant Field Values

VT_DECIMAL

public static final int VT_DECIMAL
See Also:
Constant Field Values

VT_DISPATCH

public static final int VT_DISPATCH
See Also:
Constant Field Values

VT_ARRAY

public static final int VT_ARRAY
See Also:
Constant Field Values

VT_BYREF

public static final int VT_BYREF
See Also:
Constant Field Values

VT_BYREF_VT_UI1

public static final int VT_BYREF_VT_UI1
See Also:
Constant Field Values

VT_BYREF_VT_I2

public static final int VT_BYREF_VT_I2
See Also:
Constant Field Values

VT_BYREF_VT_I4

public static final int VT_BYREF_VT_I4
See Also:
Constant Field Values

VT_BYREF_VT_R4

public static final int VT_BYREF_VT_R4
See Also:
Constant Field Values

VT_BYREF_VT_R8

public static final int VT_BYREF_VT_R8
See Also:
Constant Field Values

VT_BYREF_VT_BOOL

public static final int VT_BYREF_VT_BOOL
See Also:
Constant Field Values

VT_BYREF_VT_ERROR

public static final int VT_BYREF_VT_ERROR
See Also:
Constant Field Values

VT_BYREF_VT_CY

public static final int VT_BYREF_VT_CY
See Also:
Constant Field Values

VT_BYREF_VT_DATE

public static final int VT_BYREF_VT_DATE
See Also:
Constant Field Values

VT_BYREF_VT_BSTR

public static final int VT_BYREF_VT_BSTR
See Also:
Constant Field Values

VT_BYREF_VT_UNKNOWN

public static final int VT_BYREF_VT_UNKNOWN
See Also:
Constant Field Values

VT_BYREF_VT_DISPATCH

public static final int VT_BYREF_VT_DISPATCH
See Also:
Constant Field Values

VT_BYREF_VT_ARRAY

public static final int VT_BYREF_VT_ARRAY
See Also:
Constant Field Values

VT_BYREF_VT_VARIANT

public static final int VT_BYREF_VT_VARIANT
See Also:
Constant Field Values

VT_I1

public static final int VT_I1
See Also:
Constant Field Values

VT_UI2

public static final int VT_UI2
See Also:
Constant Field Values

VT_UI4

public static final int VT_UI4
See Also:
Constant Field Values

VT_I8

public static final int VT_I8
See Also:
Constant Field Values

VT_INT

public static final int VT_INT
See Also:
Constant Field Values

VT_UINT

public static final int VT_UINT
See Also:
Constant Field Values

VT_BYREF_VT_DECIMAL

public static final int VT_BYREF_VT_DECIMAL
See Also:
Constant Field Values

VT_BYREF_VT_I1

public static final int VT_BYREF_VT_I1
See Also:
Constant Field Values

VT_BYREF_VT_UI2

public static final int VT_BYREF_VT_UI2
See Also:
Constant Field Values

VT_BYREF_VT_UI4

public static final int VT_BYREF_VT_UI4
See Also:
Constant Field Values

VT_BYREF_VT_I8

public static final int VT_BYREF_VT_I8
See Also:
Constant Field Values

VT_BYREF_VT_INT

public static final int VT_BYREF_VT_INT
See Also:
Constant Field Values

VT_BYREF_VT_UINT

public static final int VT_BYREF_VT_UINT
See Also:
Constant Field Values

FADF_AUTO

public static final int FADF_AUTO
See Also:
Constant Field Values

FADF_STATIC

public static final int FADF_STATIC
See Also:
Constant Field Values

FADF_EMBEDDED

public static final int FADF_EMBEDDED
See Also:
Constant Field Values

FADF_FIXEDSIZE

public static final int FADF_FIXEDSIZE
See Also:
Constant Field Values

FADF_RECORD

public static final int FADF_RECORD
See Also:
Constant Field Values

FADF_HAVEIID

public static final int FADF_HAVEIID
See Also:
Constant Field Values

FADF_HAVEVARTYPE

public static final int FADF_HAVEVARTYPE
See Also:
Constant Field Values

FADF_BSTR

public static final int FADF_BSTR
See Also:
Constant Field Values

FADF_UNKNOWN

public static final int FADF_UNKNOWN
See Also:
Constant Field Values

FADF_DISPATCH

public static final int FADF_DISPATCH
See Also:
Constant Field Values

FADF_VARIANT

public static final int FADF_VARIANT
See Also:
Constant Field Values

FADF_RESERVED

public static final int FADF_RESERVED
See Also:
Constant Field Values

SCODE

public static final org.jinterop.dcom.core.JIVariant.SCODE SCODE
SCODE VARIANT

Constructor Detail

JIVariant

public JIVariant(JIVariant variant)
Setting up a VARIANT as reference to another. Used via serializing the VARIANT.

Parameters:
variant -

JIVariant

public JIVariant(int value,
                 boolean isByRef)
Setting up a VARIANT with an int. Used via serializing the VARIANT. Used when the variant type is VT_I4.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. LONG*

JIVariant

public JIVariant(long value,
                 boolean isByRef)
Setting up a VARIANT with a long. Used via serializing the VARIANT. Used when the variant type is VT_I8.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer.

JIVariant

public JIVariant(float value,
                 boolean isByRef)
Setting up a VARIANT with a float. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. FLOAT*

JIVariant

public JIVariant(boolean value,
                 boolean isByRef)
Setting up a VARIANT with a boolean. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. VARIANT_BOOL*

JIVariant

public JIVariant(double value,
                 boolean isByRef)
Setting up a VARIANT with a double. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. DOUBLE*

JIVariant

public JIVariant(short value,
                 boolean isByRef)
Setting up a VARIANT with a short. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. SHORT*

JIVariant

public JIVariant(char value,
                 boolean isByRef)
Setting up a VARIANT with a char. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. CHAR*

JIVariant

public JIVariant(JIString value,
                 boolean isByRef)
Setting up a VARIANT with a JIString. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. BSTR*

JIVariant

public JIVariant(java.lang.String value,
                 boolean isByRef)
Setting up a VARIANT with a String. Used via serializing the VARIANT. Internally a JIString is formed with it's default type BSTR.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. BSTR*

JIVariant

public JIVariant(java.lang.String value)
Setting up a VARIANT with a String. Used via serializing the VARIANT. Internally a JIString is formed with it's default type BSTR.

Parameters:
value -

JIVariant

public JIVariant(IJIComObject value,
                 boolean isByRef)
Setting up a VARIANT with an IJIComObject. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. IJIComObject**

JIVariant

public JIVariant(org.jinterop.dcom.core.JIVariant.SCODE value,
                 int errorCode,
                 boolean isByRef)
Setting up a VARIANT with a SCODE value and it's errorCode. Used via serializing the VARIANT.

Parameters:
value -
errorCode -
isByRef - true if the value is to be represented as a pointer. SCODE*

JIVariant

public JIVariant(int value)
Setting up a VARIANT with an int. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(float value)
Setting up a VARIANT with a float. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(boolean value)
Setting up a VARIANT with a boolean. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(double value)
Setting up a VARIANT with a double. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(short value)
Setting up a VARIANT with a short. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(char value)
Setting up a VARIANT with a char. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(JIString value)
Setting up a VARIANT with a JIString. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(IJIComObject value)
Setting up a VARIANT with an IJIComObject. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(java.util.Date value)
Setting up a VARIANT with an java.util.Date. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(java.util.Date value,
                 boolean isByRef)
Setting up a VARIANT with an java.util.Date. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. Date*

JIVariant

public JIVariant(JICurrency value)
Setting up a VARIANT with a JICurrency. Used via serializing the VARIANT.

Parameters:
value -

JIVariant

public JIVariant(JICurrency value,
                 boolean isByRef)
Setting up a VARIANT with a JICurrency. Used via serializing the VARIANT.

Parameters:
value -
isByRef - true if the value is to be represented as a pointer. JICurrency*

JIVariant

public JIVariant(org.jinterop.dcom.core.JIVariant.SCODE value,
                 int errorCode)
Setting up a VARIANT with a SCODE value and it's errorCode. Used via serializing the VARIANT.

Parameters:
value -
errorCode -

JIVariant

public JIVariant(JIArray array,
                 int FLAG)
Setting up a VARIANT with a JIArray. Used via serializing the VARIANT. Only 1 and 2 dimensional array is supported.

Parameters:
array -
FLAG - JIFlag value

JIVariant

public JIVariant(JIArray array,
                 boolean isByRef,
                 int FLAG)
Setting up a VARIANT with a JIArray. Used via serializing the VARIANT. Only 1 and 2 dimensional array is supported.

Parameters:
array -
isByRef -
FLAG - JIFlag value

JIVariant

public JIVariant(JIArray array,
                 boolean isByRef)
Setting up a VARIANT with a JIArray. Used via serializing the VARIANT. Only 1 and 2 dimensional array is supported.

Parameters:
array -
isByRef -

JIVariant

public JIVariant(JIArray array)
Setting up a VARIANT with a JIArray. Used via serializing the VARIANT.
Only 1 and 2 dimensional array is supported.

Parameters:
array -

JIVariant

public JIVariant(IJIUnsigned number)
Setting up a VARIANT with a unsigned value. Used via serializing the VARIANT.

Parameters:
number -

JIVariant

public JIVariant(IJIUnsigned number,
                 boolean isByRef)
Setting up a VARIANT with a unsigned value. Used via serializing the VARIANT.

Parameters:
number -
isByRef - true if the value is to be represented as a pointer.
Method Detail

OUTPARAMforType

public static JIVariant OUTPARAMforType(java.lang.Class c,
                                        boolean isArray)

makeVariant

public static JIVariant makeVariant(java.lang.Object o)
Returns a JIVariant (of the right type) based on the o.getClass()

Parameters:
o -
Returns:

makeVariant

public static JIVariant makeVariant(java.lang.Object o,
                                    boolean isByRef)
Returns a JIVariant (of the right type) based on the o.getClass()

Parameters:
o -
isByRef -
Returns:

EMPTY

public static JIVariant EMPTY()
EMPTY VARIANT. This is not Thread Safe , hence a new instance must be taken each time.


EMPTY_BYREF

public static JIVariant EMPTY_BYREF()
EMPTY BYREF VARIANT. This is not Thread Safe , hence a new instance must be taken each time. Used for a [out] VARIANT* .


OUT_IUNKNOWN

public static JIVariant OUT_IUNKNOWN()
VARIANT for ([out] IUnknown*). This is not Thread Safe , hence a new instance must be taken each time.


OUT_IDISPATCH

public static JIVariant OUT_IDISPATCH()
VARIANT for ([out] IDispatch*). This is not Thread Safe , hence a new instance must be taken each time.
Note that this must also be used when the interface pointer is a subclass of IDispatch i.e. supports automation (or is a dispinterface).


NULL

public static JIVariant NULL()
NULL VARIANT . This is not Thread Safe , hence a new instance must be taken each time.


OPTIONAL_PARAM

public static JIVariant OPTIONAL_PARAM()
OPTIONAL PARAM. Pass this when a parameter is [optional] for a COM call. This is not Thread Safe , hence a new instance must be taken each time.


BSTRARRAY

public static JIVariant BSTRARRAY()
Helper method for creating an array of BSTRs , IDL signature [in, out] SAFEARRAY(BSTR) *p. The return value can directly be used in an IJIDispatchcall.

Returns:

VARIANTARRAY

public static JIVariant VARIANTARRAY()
Helper method for creating an array of VARIANTs , IDL signature [in, out] SAFEARRAY(VARIANT) *p OR [in,out] VARIANT *pArray. The return value can directly be used in an IJIDispatch call.

Returns:

setFlag

public void setFlag(int FLAG)
Sets a JIFlags value to be used while encoding (marshalling) this Variant.

Parameters:
FLAG -

getFlag

public int getFlag()
Returns the flag value for this variant.

Returns:

isNull

public boolean isNull()
Returns whether this variant is a NULL variant.

Returns:
true if the variant is a NULL

getObject

public java.lang.Object getObject()
                           throws JIException
Returns the contained object.

Returns:
Throws:
JIException

getObjectAsInt

public int getObjectAsInt()
                   throws JIException
Retrieves the contained object as int.

Returns:
Throws:
JIException

getObjectAsFloat

public float getObjectAsFloat()
                       throws JIException
Retrieves the contained object as float.

Returns:
Throws:
JIException

getObjectAsSCODE

public int getObjectAsSCODE()
                     throws JIException
Retrieves the contained objects errorCode.

Returns:
Throws:
JIException

getObjectAsDouble

public double getObjectAsDouble()
                         throws JIException
Retrieves the contained object as double.

Returns:
Throws:
JIException

getObjectAsShort

public short getObjectAsShort()
                       throws JIException
Retrieves the contained object as short.

Returns:
Throws:
JIException

getObjectAsBoolean

public boolean getObjectAsBoolean()
                           throws JIException
Retrieves the contained object as boolean.

Returns:
Throws:
JIException

getObjectAsString

public JIString getObjectAsString()
                           throws JIException
Retrieves the contained object as JIString.

Returns:
Throws:
JIException

getObjectAsString2

public java.lang.String getObjectAsString2()
                                    throws JIException
Retrieves the contained object as String.

Returns:
Throws:
JIException

getObjectAsDate

public java.util.Date getObjectAsDate()
                               throws JIException
Retrieves the contained object as java.util.Date.

Returns:
Throws:
JIException

getObjectAsChar

public char getObjectAsChar()
                     throws JIException
Retrieves the contained object as char.

Returns:
Throws:
JIException

getObjectAsComObject

public IJIComObject getObjectAsComObject()
                                  throws JIException
Retrieves the contained object as IJIComObject. Return value must be "narrowed" to get the expected type.

for example :- If expected type is an IJIDispatch, then the return value must pass through JIObjectFactory.narrowInstance(IJIComObject) to get to the right type.

Returns:
Throws:
JIException

getObjectAsVariant

public JIVariant getObjectAsVariant()
                             throws JIException
Retrieves the contained object as JIVariant.

Returns:
Throws:
JIException

getObjectAsArray

public JIArray getObjectAsArray()
                         throws JIException
Retrieves the contained object as JIArray. Only 1 and 2 dim arrays are supported currently. Please note that this array is not backed by this variant and is a new copy. If the array is IJIComObjects, please make sure to use JIObjectFactory.narrowObject() to get the right instance.

Returns:
Throws:
JIException

getObjectAsLong

public long getObjectAsLong()
                     throws JIException
Retrieves the contained object as long, used when the expected type is VT_I8.

Returns:
Throws:
JIException

getObjectAsUnsigned

public IJIUnsigned getObjectAsUnsigned()
                                throws JIException
Retrieves the contained object as unsigned number.

Returns:
Throws:
JIException

isArray

public boolean isArray()
                throws JIException
Throws:
JIException

isByRefFlagSet

public boolean isByRefFlagSet()
                       throws JIException
Throws:
JIException

getType

public int getType()
            throws JIException
Returns the referent as integer. This can be used along with the JIVariant.VT_XX flags to find out the type of the referent.

For example :-

switch(variant.getType())
{
case JIVariant.VT_VARIANT: value = variant.getObjectAsVariant();
break;
case JIVariant.VT_NULL: ...
break;
}

Returns:
Throws:
JIException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object