|
UNO Java Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.star.uno.AnyConverter
This class provides static methods which aim at exploring the contents of an
Any and extracting its value. All public methods take an Object argument that
either is the immediate object, such as Boolean, Type, interface implementation,
or an Any that contains an object.
The methods which extract the value do a
widening conversion. See the method comments for the respective conversions.
Constructor Summary | |
AnyConverter()
|
Method Summary | |
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 |
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 a value which implements interfaces. |
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 or an Any containing a UNO object into an UNO object of a specified 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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AnyConverter()
Method Detail |
public static boolean isVoid(java.lang.Object object)
void
.
object
- the object to check
public static boolean isChar(java.lang.Object object)
char
.
object
- the object to check
public static boolean isBoolean(java.lang.Object object)
boolean
.
object
- the object to check
public static boolean isByte(java.lang.Object object)
byte
.
object
- the object to check
public static boolean isShort(java.lang.Object object)
short
.
object
- the object to check
public static boolean isInt(java.lang.Object object)
long
(which maps to a java-int).
object
- the object to check
public static boolean isLong(java.lang.Object object)
hyper
(which maps to a java-long).
object
- the object to check
public static boolean isFloat(java.lang.Object object)
float
.
object
- the object to check
public static boolean isDouble(java.lang.Object object)
double
.
object
- the object to check
public static boolean isString(java.lang.Object object)
string
.
object
- the object to check
public static boolean isType(java.lang.Object object)
type
.
object
- the object to check
public static boolean isObject(java.lang.Object object)
object
- the object to check
public static boolean isArray(java.lang.Object object)
object
- the object to check
public static char toChar(java.lang.Object object) throws com.sun.star.lang.IllegalArgumentException
object
- the object to convert
com.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 convert
com.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 convert
com.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 convert
com.sun.star.lang.IllegalArgumentException
- in case no short or byte is contained within objectpublic static int toInt(java.lang.Object object) throws com.sun.star.lang.IllegalArgumentException
object
- the object to convert
com.sun.star.lang.IllegalArgumentException
- in case no short, byte or int is contained within object.public static long toLong(java.lang.Object object) throws com.sun.star.lang.IllegalArgumentException
object
- the object to convert
com.sun.star.lang.IllegalArgumentException
- in case no short, byte, int or long
is contained within object.public static float toFloat(java.lang.Object object) throws com.sun.star.lang.IllegalArgumentException
object
- the object to convert
com.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 convert
com.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 convert
com.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 convert
com.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
- the Type of the returned valueobject
- the object that is to be converted
com.sun.star.lang.IllegalArgumentException
- in case no UNO object is contained within object.public static java.lang.Object toArray(java.lang.Object object) throws com.sun.star.lang.IllegalArgumentException
object
- the object to convert
com.sun.star.lang.IllegalArgumentException
- in case no array is contained within object.
|
UNO Java Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |