public class AnyConverter
extends java.lang.Object
| Constructor and Description |
|---|
AnyConverter() |
| Modifier and Type | Method and Description |
|---|---|
static Type |
getType(java.lang.Object object)
Determines the type of an any object.
|
static boolean |
isArray(java.lang.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(java.lang.Object object)
checks if the any contains a value of the idl type
boolean. |
static boolean |
isByte(java.lang.Object object)
checks if the any contains a value of the idl type
byte. |
static boolean |
isChar(java.lang.Object object)
checks if the any contains a value of the idl type
char. |
static boolean |
isDouble(java.lang.Object object)
checks if the any contains a value of the idl type
double. |
static boolean |
isEnum(java.lang.Object object)
checks if the any contains a value of the idl type
enum. |
static boolean |
isFloat(java.lang.Object object)
checks if the any contains a value of the idl type
float. |
static boolean |
isInt(java.lang.Object object)
checks if the any contains a value of the idl type
long (which maps to a java-int). |
static boolean |
isLong(java.lang.Object object)
checks if the any contains a value of the idl type
hyper (which maps to a java-long). |
static boolean |
isObject(java.lang.Object object)
checks if the any contains an interface, struct, exception, sequence or enum.
|
static boolean |
isShort(java.lang.Object object)
checks if the any contains a value of the idl type
short. |
static boolean |
isString(java.lang.Object object)
checks if the any contains a value of the idl type
string. |
static boolean |
isType(java.lang.Object object)
checks if the any contains a value of the idl type
type. |
static boolean |
isVoid(java.lang.Object object)
checks if the any contains the idl type
void. |
static java.lang.Object |
toArray(java.lang.Object object)
converts an array or an any containing an array into an array.
|
static boolean |
toBoolean(java.lang.Object object)
converts an Boolean object or an Any object containing a Boolean object into a simple boolean.
|
static byte |
toByte(java.lang.Object object)
converts an Byte object or an Any object containing a Byte object into a simple byte.
|
static char |
toChar(java.lang.Object object)
converts an Char object or an Any object containing a Char object into a simple char.
|
static double |
toDouble(java.lang.Object object)
converts a number object into a simple double and allows widening conversions.
|
static float |
toFloat(java.lang.Object object)
converts a number object into a simple float and allows widening conversions.
|
static int |
toInt(java.lang.Object object)
converts a number object into a simple int and allows widening conversions.
|
static long |
toLong(java.lang.Object object)
converts a number object into a simple long and allows widening conversions.
|
static java.lang.Object |
toObject(Type type,
java.lang.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(java.lang.Object object)
converts a number object into a simple short and allows widening conversions.
|
static java.lang.String |
toString(java.lang.Object object)
converts a string or an any containing a string into a string.
|
static Type |
toType(java.lang.Object object)
converts a Type or an any containing a Type into a Type.
|
static int |
toUnsignedInt(java.lang.Object object)
converts a number object into an idl unsigned long and allows widening conversions.
|
static long |
toUnsignedLong(java.lang.Object object)
converts a number object into an idl unsigned hyper and allows widening conversions.
|
static short |
toUnsignedShort(java.lang.Object object)
converts a number object into an idl unsigned short and allows widening conversions.
|
public static Type getType(java.lang.Object object)
object - any objectpublic static boolean isVoid(java.lang.Object object)
void.object - the object to checkpublic static boolean isChar(java.lang.Object object)
char.object - the object to checkpublic static boolean isBoolean(java.lang.Object object)
boolean.object - the object to checkpublic static boolean isByte(java.lang.Object object)
byte.object - the object to checkpublic static boolean isShort(java.lang.Object object)
short.object - the object to checkpublic static boolean isInt(java.lang.Object object)
long (which maps to a java-int).object - the object to checkpublic static boolean isLong(java.lang.Object object)
hyper (which maps to a java-long).object - the object to checkpublic static boolean isFloat(java.lang.Object object)
float.object - the object to checkpublic static boolean isDouble(java.lang.Object object)
double.object - the object to checkpublic static boolean isString(java.lang.Object object)
string.object - the object to checkpublic static boolean isEnum(java.lang.Object object)
enum.object - the object to checkpublic static boolean isType(java.lang.Object object)
type.object - the object to checkpublic static boolean isObject(java.lang.Object object)
object - the object to checkpublic static boolean isArray(java.lang.Object object)
object - the object to checkpublic static char toChar(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no char is contained within objectisChar(java.lang.Object)public static boolean toBoolean(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no boolean is contained within objectisBoolean(java.lang.Object)public static byte toByte(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no byte is contained within objectisBoolean(java.lang.Object)public static short toShort(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no short or byte is contained within objectpublic static short toUnsignedShort(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no idl unsigned short is contained within Anypublic static int toInt(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no short, byte or int is contained within object.public static int toUnsignedInt(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no idl unsigned short nor unsigned long is contained within Anypublic static long toLong(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no short, byte, int or long
is contained within object.public static long toUnsignedLong(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no idl unsigned short, nor unsigned long nor unsigned hyper
is contained within object.public static float toFloat(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no byte, short or float
is contained within object.public static double toDouble(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no byte, short, int, float
or double is contained within object.public static java.lang.String toString(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no string is contained within object.public static Type toType(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no type is contained within object.public static java.lang.Object toObject(Type type,
java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
type - type of the returned valueobject - the object that is to be convertedcom.sun.star.lang.IllegalArgumentException - in case conversion is not possiblepublic static java.lang.Object toArray(java.lang.Object object)
throws com.sun.star.lang.IllegalArgumentException
object - the object to convertcom.sun.star.lang.IllegalArgumentException - in case no array is contained within object.