public enum NativeType extends Enum<NativeType>
Enum Constant and Description |
---|
Bool
The native type is 'BOOL' (defined as 'int')
where true maps to -1 and false maps to 0.
|
BSTR
BSTR.
|
BSTR_ByRef
BSTR*.
|
ComObject
COM interface pointer.
|
ComObject_ByRef
COM interface pointer by reference.
|
CSTR
String will be marshaled as "char*".
|
Currency
CURRENCY.
|
Currency_ByRef |
Date
DATE.
|
Default
The native type is determined from the Java method return type.
|
Dispatch
IDispatch*
|
Double
double.
|
Double_ByRef |
Float
float.
|
Float_ByRef |
GUID
GUID.
|
HRESULT
Used only with
ReturnValue for returning
HRESULT of the method invocation as "int". |
Int16
INT16 (short).
|
Int16_ByRef
Int16 passed by reference |
Int32
Marshalled as 32-bit integer.
|
Int32_ByRef |
Int64
Marshalled as 64-bit integer.
|
Int64_ByRef |
Int8
INT8 (byte).
|
Int8_ByRef
Int8 passed by reference
TODO should we add enum message/unmessage? |
PVOID
PVOID.
|
PVOID_ByRef
void**.
|
SafeArray
SAFEARRAY.
|
Unicode
LPWSTR.
|
VARIANT
VARIANT.
|
VARIANT_ByRef
VARIANT*.
|
VariantBool
The native type is 'VARIANT_BOOL' where TRUE=1 and FALSE=0.
|
VariantBool_ByRef |
Modifier and Type | Method and Description |
---|---|
NativeType |
byRef()
If the constant has the BYREF version, return it.
|
NativeType |
getNoByRef() |
static NativeType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static NativeType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final NativeType BSTR
Expected Java type: String
public static final NativeType BSTR_ByRef
Expected Java type:
Holder
<String>
public static final NativeType Unicode
public static final NativeType CSTR
More concretely, it becomes a '\0'-terminated multi-byte string where characters are encoded according to the platform default encoding.
For example, on a typical English Windows system this is just an ASCII string (more or less). On a typical Japanese Windows system, this is Shift-JIS.
public static final NativeType Int8
Expected Java type:
byte
Number
public static final NativeType Int8_ByRef
Int8
passed by reference
TODO should we add enum message/unmessage?public static final NativeType Int16
Expected Java type:
short
Number
public static final NativeType Int16_ByRef
Int16
passed by referencepublic static final NativeType Int32
public static final NativeType Int32_ByRef
public static final NativeType Bool
Expected Java type:
boolean
Boolean
public static final NativeType VariantBool
Expected Java type:
boolean
Boolean
public static final NativeType VariantBool_ByRef
public static final NativeType Int64
Java "long" is 64 bit.
Expected Java type:
long
Number
public static final NativeType Int64_ByRef
public static final NativeType Float
Expected Java type:
boolean
Number
public static final NativeType Float_ByRef
public static final NativeType Double
Expected Java type:
boolean
Number
public static final NativeType Double_ByRef
public static final NativeType HRESULT
ReturnValue
for returning
HRESULT of the method invocation as "int".public static final NativeType Default
public static final NativeType ComObject
Expected Java type:
Com4jObject
public static final NativeType ComObject_ByRef
Expected Java type:
Holder<ComObject>
public static final NativeType GUID
Passed by reference in COM convention but it doesn't have the "out" semantics.
Expected Java type:
GUID
public static final NativeType VARIANT
Expected Java type:
Variant
Object
When the Java type is Object
, the type of the created
VARIANT is determined at run-time from the actual type
of the Java object being passed in. The following table describes
this inferene process:
Java type | COM VARIANT type |
Boolean / boolean
| VT_BOOL |
String
| VT_BSTR |
Float / float
| VT_R4 |
Double / double
| VT_R8 |
Short / short
| VT_I2 |
Integer / int
| VT_I4 |
Long / long
| VT_I8 |
Com4jObject or its derived types
| VT_UNKNOWN |
public static final NativeType VARIANT_ByRef
This works like VARIANT
, except that a reference
is passed, instead of a VARIANT itself.
public static final NativeType Dispatch
Expected Java type:
Com4jObject
public static final NativeType PVOID
The assumed semantics is that a region of buffer will be passed to the native method.
Expected Java type:
direct Buffer
s (Buffer
s created from methods like
ByteBuffer.allocateDirect(int)
public static final NativeType PVOID_ByRef
The assumed semantics is that you receive a buffer.
Expected Java type:
Holder
<Buffer
> (Buffer
s created from methods like
ByteBuffer.allocateDirect(int)
public static final NativeType Date
public static final NativeType Currency
CURRENCY is implemented as an 8-byte two's-complement integer value scaled by 10,000. This gives a fixed-point number with 15 digits to the left of the decimal point and 4 digits to the right. The CURRENCY data type is extremely useful for calculations involving money, or for any fixed-point calculations where accuracy is important.
Expected Java type:
BigDecimal
public static final NativeType Currency_ByRef
public static final NativeType SafeArray
The given java type is converted into a SAFEARRAY before passed to the native method. When the Java type is an array, the component type of the SAFEARRAY is automatically derived from the component type of the Java array. This inference is defined as follows:
public static NativeType[] values()
for (NativeType c : NativeType.values()) System.out.println(c);
public static NativeType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant
with the specified nameNullPointerException
- if the argument is nullpublic final NativeType byRef()
public final NativeType getNoByRef()
Copyright © 2014. All rights reserved.