com.sun.star.uno
public class AnyConverter extends Object
Method Summary | |
---|---|
static Type | getType(Object object) Determines the type of an any object. |
static boolean | isArray(Object object) checks if the any contains UNO idl sequence value (meaning a java array
containing elements which are values of UNO idl types). |
static boolean | isBoolean(Object object) checks if the any contains a value of the idl type boolean . |
static boolean | isByte(Object object) checks if the any contains a value of the idl type byte . |
static boolean | isChar(Object object) checks if the any contains a value of the idl type char . |
static boolean | isDouble(Object object) checks if the any contains a value of the idl type double . |
static boolean | isEnum(Object object) checks if the any contains a value of the idl type enum . |
static boolean | isFloat(Object object) checks if the any contains a value of the idl type float . |
static boolean | isInt(Object object) checks if the any contains a value of the idl type long (which maps to a java-int). |
static boolean | isLong(Object object) checks if the any contains a value of the idl type hyper (which maps to a java-long). |
static boolean | isObject(Object object) checks if the any contains an interface, struct, exception, sequence or enum.
|
static boolean | isShort(Object object) checks if the any contains a value of the idl type short . |
static boolean | isString(Object object) checks if the any contains a value of the idl type string . |
static boolean | isType(Object object) checks if the any contains a value of the idl type type . |
static boolean | isVoid(Object object) checks if the any contains the idl type void . |
static Object | toArray(Object object) converts an array or an any containing an array into an array. |
static boolean | toBoolean(Object object) converts an Boolean object or an Any object containing a Boolean object into a simple boolean. |
static byte | toByte(Object object) converts an Byte object or an Any object containing a Byte object into a simple byte. |
static char | toChar(Object object) converts an Char object or an Any object containing a Char object into a simple char. |
static double | toDouble(Object object) converts a number object into a simple double and allows widening conversions.
|
static float | toFloat(Object object) converts a number object into a simple float and allows widening conversions.
|
static int | toInt(Object object) converts a number object into a simple int and allows widening conversions.
|
static long | toLong(Object object) converts a number object into a simple long and allows widening conversions.
|
static Object | toObject(Type type, Object object) converts a UNO object (struct, exception, sequence, enum or interface) or an Any containing
these types into an UNO object of a specified destination type.
|
static Object | toObject(Class clazz, Object object) converts a UNO object (struct, exception, sequence, enum or interface) or an Any containing
these types into an UNO object of a specified destination type.
|
static short | toShort(Object object) converts a number object into a simple short and allows widening conversions.
|
static String | toString(Object object) converts a string or an any containing a string into a string. |
static Type | toType(Object object) converts a Type or an any containing a Type into a Type. |
static int | toUnsignedInt(Object object) converts a number object into an idl unsigned long and allows widening conversions.
|
static long | toUnsignedLong(Object object) converts a number object into an idl unsigned hyper and allows widening conversions.
|
static short | toUnsignedShort(Object object) converts a number object into an idl unsigned short and allows widening conversions.
|
Parameters: object any object
Returns: type object
Parameters: object the object to check
Returns: true when the any contains an object which implements interfaces, false otherwise.
boolean
.Parameters: object the object to check
Returns: true when the any contains a boolean, false otherwise.
byte
.Parameters: object the object to check
Returns: true when the any contains a byte, false otherwise.
char
.Parameters: object the object to check
Returns: true when the any contains a char, false otherwise.
double
.Parameters: object the object to check
Returns: true when the any contains a double, false otherwise.
enum
.Parameters: object the object to check
Returns: true if the any contains an enum, false otherwise
float
.Parameters: object the object to check
Returns: true when the any contains a float, false otherwise.
long
(which maps to a java-int).Parameters: object the object to check
Returns: true when the any contains a int, false otherwise.
hyper
(which maps to a java-long).Parameters: object the object to check
Returns: true when the any contains a long, false otherwise.
Parameters: object the object to check
Returns: true if the any contains an object
short
.Parameters: object the object to check
Returns: true when the any contains a short, false otherwise.
string
.Parameters: object the object to check
Returns: true when the any contains a string, false otherwise.
type
.Parameters: object the object to check
Returns: true when the any contains a type, false otherwise.
void
.Parameters: object the object to check
Returns: true when the any is void, false otherwise
Parameters: object the object to convert
Returns: the array contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no array is contained within object.
Parameters: object the object to convert
Returns: the boolean contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no boolean is contained within object
See Also: AnyConverter
Parameters: object the object to convert
Returns: the boolean contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no byte is contained within object
See Also: AnyConverter
Parameters: object the object to convert
Returns: the char contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no char is contained within object
See Also: AnyConverter
Parameters: object the object to convert
Returns: the double contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no byte, short, int, float or double is contained within object.
Parameters: object the object to convert
Returns: the float contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no byte, short or float is contained within object.
Parameters: object the object to convert
Returns: the int contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no short, byte or int is contained within object.
Parameters: object the object to convert
Returns: the long contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no short, byte, int or long is contained within object.
Parameters: type type of the returned value object the object that is to be converted
Returns: destination object
Throws: com.sun.star.lang.IllegalArgumentException in case conversion is not possible
Parameters: clazz class of the returned value object the object that is to be converted
Returns: destination object
Throws: com.sun.star.lang.IllegalArgumentException in case conversion is not possible
Parameters: object the object to convert
Returns: the short contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no short or byte is contained within object
Parameters: object the object to convert
Returns: the string contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no string is contained within object.
Parameters: object the object to convert
Returns: the type contained within the object
Throws: com.sun.star.lang.IllegalArgumentException in case no type is contained within object.
Parameters: object the object to convert
Returns: an (unsigned) int
Throws: com.sun.star.lang.IllegalArgumentException in case no idl unsigned short nor unsigned long is contained within Any
Parameters: object the object to convert
Returns: an (unsigned) long
Throws: com.sun.star.lang.IllegalArgumentException in case no idl unsigned short, nor unsigned long nor unsigned hyper is contained within object.
Parameters: object the object to convert
Returns: an (unsigned) short
Throws: com.sun.star.lang.IllegalArgumentException in case no idl unsigned short is contained within Any