Package com.sun.star.lib.uno.typedesc
Class TypeDescription
- java.lang.Object
-
- com.sun.star.lib.uno.typedesc.TypeDescription
-
public final class TypeDescription extends java.lang.Object
Supplies information about UNO types. Allows to examine a type in detail (e.g. it is used for marshaling/unmarshaling).- Since:
- UDK2.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getArrayTypeName()
Gets the (Java) array type name.TypeDescription
getComponentType()
Gets the componentTypeDescription
if this is an array type, otherwise returnsnull
.FieldDescription
getFieldDescription(java.lang.String name)
Gets theFieldDescription
for the field with the namename
, if it exists, otherwise returnsnull
.FieldDescription[]
getFieldDescriptions()
Gets theFieldDescription
for every field, if this type is an interface.MethodDescription
getMethodDescription(int methodId)
Gets theMethodDescription
for the method with index methodId, if it exists, otherwise returnsnull
.MethodDescription
getMethodDescription(java.lang.String name)
Gets theMethodDescription
for the method with the namename
, if it exists, otherwise returnsnull
.MethodDescription[]
getMethodDescriptions()
Gets theMethodDescription
for every method, if this type is an interface.TypeDescription
getSuperType()
Gets theTypeDescription
of the super, if it exists.com.sun.star.uno.TypeClass
getTypeClass()
Gets the IDLTypeClass
of the type.static TypeDescription
getTypeDescription(Type type)
static TypeDescription
getTypeDescription(com.sun.star.uno.TypeClass typeClass)
static TypeDescription
getTypeDescription(java.lang.Class<?> zClass)
static TypeDescription
getTypeDescription(java.lang.String typeName)
java.lang.String
getTypeName()
Gets the (UNO) type name.java.lang.Class<?>
getZClass()
Gets the corresponding java class for the type.boolean
hasTypeArguments()
static boolean
isTypeClassSimple(com.sun.star.uno.TypeClass typeClass)
java.lang.String
toString()
-
-
-
Method Detail
-
getTypeDescription
public static TypeDescription getTypeDescription(java.lang.String typeName) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
getTypeDescription
public static TypeDescription getTypeDescription(java.lang.Class<?> zClass)
-
getTypeDescription
public static TypeDescription getTypeDescription(Type type) throws java.lang.ClassNotFoundException
- Throws:
java.lang.ClassNotFoundException
-
getTypeDescription
public static TypeDescription getTypeDescription(com.sun.star.uno.TypeClass typeClass)
-
isTypeClassSimple
public static boolean isTypeClassSimple(com.sun.star.uno.TypeClass typeClass)
-
getSuperType
public TypeDescription getSuperType()
Gets theTypeDescription
of the super, if it exists.- Returns:
- the
TypeDescription
.
-
getMethodDescriptions
public MethodDescription[] getMethodDescriptions()
Gets theMethodDescription
for every method, if this type is an interface. Otherwise returnsnull
.- Returns:
- the
MethodDescription[]
.
-
getMethodDescription
public MethodDescription getMethodDescription(int methodId)
Gets theMethodDescription
for the method with index methodId, if it exists, otherwise returnsnull
.- Parameters:
methodId
- the index.- Returns:
- the
MethodDescription
.
-
getMethodDescription
public MethodDescription getMethodDescription(java.lang.String name)
Gets theMethodDescription
for the method with the namename
, if it exists, otherwise returnsnull
.- Parameters:
name
- the name of the method.- Returns:
- the
MethodDescription
.
-
getFieldDescriptions
public FieldDescription[] getFieldDescriptions()
Gets theFieldDescription
for every field, if this type is an interface. Otherwise returnsnull
.- Returns:
- the
FieldDescription[]
.
-
getFieldDescription
public FieldDescription getFieldDescription(java.lang.String name)
Gets theFieldDescription
for the field with the namename
, if it exists, otherwise returnsnull
.- Parameters:
name
- the name of the field.- Returns:
- the
FieldDescription
.
-
getTypeClass
public com.sun.star.uno.TypeClass getTypeClass()
Gets the IDLTypeClass
of the type.- Returns:
- the
TypeClass
.
-
getComponentType
public TypeDescription getComponentType()
Gets the componentTypeDescription
if this is an array type, otherwise returnsnull
.- Returns:
- the
TypeDescription
-
getTypeName
public java.lang.String getTypeName()
Gets the (UNO) type name.Mapping from UNO types to type names UNO type type name VOID "void"
BOOLEAN "boolean"
CHAR "char"
BYTE "byte"
SHORT "short"
UNSIGNED SHORT "unsigned short"
LONG "long"
UNSIGNED LONG "unsigned long"
HYPER "hyper"
UNSIGNED HYPER "unsigned hyper"
FLOAT "float"
DOUBLE "double"
STRING "string"
TYPE "type"
ANY "any"
sequence type of base type T "[]"
followed by type name for Tenum type named N N (see below) struct type named N N (see below) exception type named N N (see below) interface type named N N (see below) For a UNO type named N, consisting of a sequence of module names M1, ..., Mn followed by a simple name S, the corresponding type name consists of the same sequence of module names and simple name, with
"."
separating the individual elements.- Returns:
- the type name.
-
getArrayTypeName
public java.lang.String getArrayTypeName()
Gets the (Java) array type name.The array type name is defined to be the Java class name (as returned by
Class.forName
) of the Java array class that corresponds to the UNO sequence type with this type (the UNO type represented by thisTypeDescription
instance) as base type. For anTypeDescription
instance representing the UNO type VOID, the array type name is defined to be"[Ljava.lang.Void;"
.- Returns:
- the array type name.
-
getZClass
public java.lang.Class<?> getZClass()
Gets the corresponding java class for the type.- Returns:
- the corresponding java class.
-
hasTypeArguments
public boolean hasTypeArguments()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-