org.jinterop.dcom.core
Class JIString

java.lang.Object
  extended byorg.jinterop.dcom.core.JIString
All Implemented Interfaces:
java.io.Serializable

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

Class representing a COM string. The Wide Char (LPWSTR) and the BSTR are both encoded by the server in "UTF-16LE". This encoding will be preserved by the library for all to and fro operations.

Since:
1.0
See Also:
Serialized Form

Field Summary
 JIVariant Variant
          Represents JIVariant for this object, it is valid only if this object is a BSTR (JIFlags.FLAG_REPRESENTATION_STRING_BSTR) type.
 JIVariant VariantByRef
          Represents JIVariant(byRef = true) for this object, it is valid only if this object is a BSTR (JIFlags.FLAG_REPRESENTATION_STRING_BSTR) type.
 
Constructor Summary
JIString(int type)
          Creates an object of the specified type.
JIString(java.lang.String str)
          Creates a object of the BSTR type.
JIString(java.lang.String str, int type)
          Creates a string object of a given type.
 
Method Summary
 java.lang.String getString()
          String encapsulated by this object.
 int getType()
          Type representing this object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Variant

public final JIVariant Variant
Represents JIVariant for this object, it is valid only if this object is a BSTR (JIFlags.FLAG_REPRESENTATION_STRING_BSTR) type.


VariantByRef

public final JIVariant VariantByRef
Represents JIVariant(byRef = true) for this object, it is valid only if this object is a BSTR (JIFlags.FLAG_REPRESENTATION_STRING_BSTR) type.

Constructor Detail

JIString

public JIString(int type)
Creates an object of the specified type. Used while deserialiazing this object.

Parameters:
type - JIFlags string flags
Throws:
java.lang.IllegalArgumentException - if type is not a string flag.
See Also:
JIFlags.FLAG_REPRESENTATION_STRING_BSTR, JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR

JIString

public JIString(java.lang.String str,
                int type)
Creates a string object of a given type.

Parameters:
str - value encapsulated by this object.
type - JIFlags string flags
Throws:
java.lang.IllegalArgumentException - if type is not a string flag.
See Also:
JIFlags.FLAG_REPRESENTATION_STRING_BSTR, JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR

JIString

public JIString(java.lang.String str)
Creates a object of the BSTR type.

Parameters:
str - value encapsulated by this object.
Method Detail

getString

public java.lang.String getString()
String encapsulated by this object. The encoding scheme for LPWSTR and BSTR strings is "UTF-16LE".

Returns:

getType

public int getType()
Type representing this object.

Returns:
JIFlags string flags
See Also:
JIFlags.FLAG_REPRESENTATION_STRING_BSTR, JIFlags.FLAG_REPRESENTATION_STRING_LPCTSTR, JIFlags.FLAG_REPRESENTATION_STRING_LPWSTR

toString

public java.lang.String toString()