Top Description Constructors Methods
com.sun.jna.platform.win32.COM.util

pack-priv Class Convert

extends Object
Class Inheritance
Imports
com.sun.jna.platform.win32.OleAuto, .Variant, .WinDef, .Variant.VARIANT, .WTypes.BSTR, .OaIdl, .WinDef.PVOID, java.lang.reflect.InvocationHandler, .InvocationTargetException, .Method, .Proxy, .Constructor, java.util.Date

This class is considered internal to the package.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public static void
free(Variant.VARIANT
to be cleared
variant
,
Class<?>
type before/after conversion
javaType
)

Free the contents of the supplied VARIANT.

public static void
free(Variant.VARIANT
to be cleared
variant
,
Object
value before/after conversion
value
)

Free the contents of the supplied VARIANT.

public static <T extends IComEnum> T
toComEnum(Class<T> enumType, Object value)

public static Object
toJavaObject(Variant.VARIANT value, Class<?> targetClass, ObjectFactory factory, boolean addReference, boolean freeValue)

public static Variant.VARIANT

Returns:

wrapped VARIANT
toVariant
(Object
to be wrapped
value
)

Convert a java value into a VARIANT suitable for passing in a COM invocation.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Convertback to summary
pack-priv Convert()

Method Detail

freeback to summary
public static void free(Variant.VARIANT variant, Class<?> javaType)

Free the contents of the supplied VARIANT.

This method is a companion to toVariant. Primary usage is to free BSTRs contained in VARIANTs.

Parameters
variant:Variant.VARIANT

to be cleared

javaType:Class<?>

type before/after conversion

freeback to summary
public static void free(Variant.VARIANT variant, Object value)

Free the contents of the supplied VARIANT.

This method is a companion to toVariant. Primary usage is to free BSTRs contained in VARIANTs.

Parameters
variant:Variant.VARIANT

to be cleared

value:Object

value before/after conversion

toComEnumback to summary
public static <T extends IComEnum> T toComEnum(Class<T> enumType, Object value)
toJavaObjectback to summary
public static Object toJavaObject(Variant.VARIANT value, Class<?> targetClass, ObjectFactory factory, boolean addReference, boolean freeValue)
toVariantback to summary
public static Variant.VARIANT toVariant(Object value)

Convert a java value into a VARIANT suitable for passing in a COM invocation.

Implementation Notes

  • VARIANTs are not rewrapped, but passed through unmodified
  • A string is wrapped into a BSTR, that is wrapped into the VARIANT. The string is allocated as native memory by the VARIANT constructor. The BSTR needs to be freed by com.sun.jna.platform.win32.OleAuto#SysFreeString.
Parameters
value:Object

to be wrapped

Returns:Variant.VARIANT

wrapped VARIANT

Annotations
@SuppressWarnings:deprecation