Top Description Inners Fields Constructors Methods
com.sun.star.lib.uno.typedesc

public final Class TypeDescription

extends Object
Class Inheritance
Imports
com.sun.star.lib.uno.typeinfo.AttributeTypeInfo, .MemberTypeInfo, .MethodTypeInfo, .ParameterTypeInfo, .TypeInfo, com.sun.star.uno.Type, com.sun.star.uno.TypeClass, java.lang.ref.ReferenceQueue, .SoftReference, java.lang.reflect.Field, .Method, java.util.ArrayList, .HashMap

Supplies information about UNO types. Allows to examine a type in detail (e.g. it is used for marshaling/unmarshaling).
Since
UDK2.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final String
private static final TypeDescription.Cache
private final TypeDescription
private final FieldDescription[]
private final boolean
private MethodDescription[]
private MethodDescription[]
private final TypeDescription[]
private final com.sun.star.uno.TypeClass
private final String
private final Class<?>

Constructor Summary

AccessConstructor and Description
private
TypeDescription(com.sun.star.uno.TypeClass typeClass, String typeName, String arrayTypeName, Class<?> zClass, TypeDescription[] superTypes, TypeDescription componentType)

Method Summary

Modifier and TypeMethod and Description
private FieldDescription[]
private TypeDescription[]
private static TypeDescription
create(Type type)

private Method
findMethod(Method[] methods, String name)

private static TypeDescription
get(Type type)

public String

Returns:

the array type name.
getArrayTypeName
()

Gets the (Java) array type name.

public TypeDescription

Returns:

the TypeDescription
getComponentType
()

Gets the component TypeDescription if this is an array type, otherwise returns null.

private static TypeDescription
public FieldDescription

Returns:

the FieldDescription.
getFieldDescription
(String
the name of the field.
name
)

Gets the FieldDescription for the field with the name name, if it exists, otherwise returns null.

public FieldDescription[]

Returns:

the FieldDescription[].
getFieldDescriptions
()

Gets the FieldDescription for every field, if this type is an interface.

public MethodDescription

Returns:

the MethodDescription.
getMethodDescription
(int
the index.
methodId
)

Gets the MethodDescription for the method with index methodId, if it exists, otherwise returns null.

public MethodDescription

Returns:

the MethodDescription.
getMethodDescription
(String
the name of the method.
name
)

Gets the MethodDescription for the method with the name name, if it exists, otherwise returns null.

public MethodDescription[]

Returns:

the MethodDescription[].
getMethodDescriptions
()

Gets the MethodDescription for every method, if this type is an interface.

public TypeDescription

Returns:

the TypeDescription.
getSuperType
()

Gets the TypeDescription of the super, if it exists.

public com.sun.star.uno.TypeClass

Returns:

the TypeClass.
getTypeClass
()

Gets the IDL TypeClass of the type.

public static TypeDescription
public static TypeDescription
public static TypeDescription
public static TypeDescription
getTypeDescription(com.sun.star.uno.TypeClass typeClass)

private static TypeDescription
getTypeDescription(Class<?> zClass, TypeInfo typeInfo)

private TypeInfo[]
public String

Returns:

the type name.
getTypeName
()

Gets the (UNO) type name.

public Class<?>

Returns:

the corresponding java class.
getZClass
()

Gets the corresponding java class for the type.

public boolean
private synchronized void
public static boolean
isTypeClassSimple(com.sun.star.uno.TypeClass typeClass)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

arrayTypeNameback to summary
private final String arrayTypeName
cacheback to summary
private static final TypeDescription.Cache cache
componentTypeback to summary
private final TypeDescription componentType
fieldDescriptionsback to summary
private final FieldDescription[] fieldDescriptions
hasTypeArgumentsback to summary
private final boolean hasTypeArguments
methodDescriptionsback to summary
private MethodDescription[] methodDescriptions
superMethodDescriptionsback to summary
private MethodDescription[] superMethodDescriptions
superTypesback to summary
private final TypeDescription[] superTypes
typeClassback to summary
private final com.sun.star.uno.TypeClass typeClass
typeNameback to summary
private final String typeName
zClassback to summary
private final Class<?> zClass

Constructor Detail

TypeDescriptionback to summary
private TypeDescription(com.sun.star.uno.TypeClass typeClass, String typeName, String arrayTypeName, Class<?> zClass, TypeDescription[] superTypes, TypeDescription componentType)

Method Detail

calculateFieldDescriptionsback to summary
private FieldDescription[] calculateFieldDescriptions(TypeDescription[] typeArguments)
calculateTypeArgumentsback to summary
private TypeDescription[] calculateTypeArguments()
createback to summary
private static TypeDescription create(Type type) throws ClassNotFoundException
findMethodback to summary
private Method findMethod(Method[] methods, String name)
getback to summary
private static TypeDescription get(Type type) throws ClassNotFoundException
getArrayTypeNameback to summary
public 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 this TypeDescription instance) as base type. For an TypeDescription instance representing the UNO type VOID, the array type name is defined to be "[Ljava.lang.Void;".

Returns:String

the array type name.

getComponentTypeback to summary
public TypeDescription getComponentType()

Gets the component TypeDescription if this is an array type, otherwise returns null.

Returns:TypeDescription

the TypeDescription

getDefinitelyback to summary
private static TypeDescription getDefinitely(Type type)
getFieldDescriptionback to summary
public FieldDescription getFieldDescription(String name)

Gets the FieldDescription for the field with the name name, if it exists, otherwise returns null.

Parameters
name:String

the name of the field.

Returns:FieldDescription

the FieldDescription.

getFieldDescriptionsback to summary
public FieldDescription[] getFieldDescriptions()

Gets the FieldDescription for every field, if this type is an interface. Otherwise returns null.

Returns:FieldDescription[]

the FieldDescription[].

getMethodDescriptionback to summary
public MethodDescription getMethodDescription(int methodId)

Gets the MethodDescription for the method with index methodId, if it exists, otherwise returns null.

Parameters
methodId:int

the index.

Returns:MethodDescription

the MethodDescription.

getMethodDescriptionback to summary
public MethodDescription getMethodDescription(String name)

Gets the MethodDescription for the method with the name name, if it exists, otherwise returns null.

Parameters
name:String

the name of the method.

Returns:MethodDescription

the MethodDescription.

getMethodDescriptionsback to summary
public MethodDescription[] getMethodDescriptions()

Gets the MethodDescription for every method, if this type is an interface. Otherwise returns null.

Returns:MethodDescription[]

the MethodDescription[].

getSuperTypeback to summary
public TypeDescription getSuperType()

Gets the TypeDescription of the super, if it exists.

Returns:TypeDescription

the TypeDescription.

getTypeClassback to summary
public com.sun.star.uno.TypeClass getTypeClass()

Gets the IDL TypeClass of the type.

Returns:com.sun.star.uno.TypeClass

the TypeClass.

getTypeDescriptionback to summary
public static TypeDescription getTypeDescription(String typeName) throws ClassNotFoundException
getTypeDescriptionback to summary
public static TypeDescription getTypeDescription(Class<?> zClass)
getTypeDescriptionback to summary
public static TypeDescription getTypeDescription(Type type) throws ClassNotFoundException
getTypeDescriptionback to summary
public static TypeDescription getTypeDescription(com.sun.star.uno.TypeClass typeClass)
getTypeDescriptionback to summary
private static TypeDescription getTypeDescription(Class<?> zClass, TypeInfo typeInfo)
getTypeInfoback to summary
private TypeInfo[] getTypeInfo()
getTypeNameback to summary
public String getTypeName()

Gets the (UNO) type name.

Mapping from UNO types to type names
UNO typetype 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 T
enum 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:String

the type name.

getZClassback to summary
public Class<?> getZClass()

Gets the corresponding java class for the type.

Returns:Class<?>

the corresponding java class.

hasTypeArgumentsback to summary
public boolean hasTypeArguments()
initMethodDescriptionsback to summary
private synchronized void initMethodDescriptions()
isTypeClassSimpleback to summary
public static boolean isTypeClassSimple(com.sun.star.uno.TypeClass typeClass)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
com.sun.star.lib.uno.typedesc back to summary

private final Class TypeDescription.Cache

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final HashMap<String, TypeDescription.Cache.Entry>
private final ReferenceQueue<TypeDescription>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
public TypeDescription
get(String typeName)

public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
private final HashMap<String, TypeDescription.Cache.Entry> map
queueback to summary
private final ReferenceQueue<TypeDescription> queue

Constructor Detail

Cacheback to summary
private Cache()

Method Detail

cleanUpback to summary
private void cleanUp()
getback to summary
public TypeDescription get(String typeName)
putback to summary
public void put(TypeDescription desc)
com.sun.star.lib.uno.typedesc back to summary

private final Class TypeDescription.Cache.Entry

extends SoftReference<TypeDescription>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from java.lang.ref.SoftReference:
get

Field Detail

typeNameback to summary
public final String typeName

Constructor Detail

Entryback to summary
public Entry(TypeDescription desc, ReferenceQueue<TypeDescription> queue)
com.sun.star.lib.uno.typedesc back to summary

private final Class TypeDescription.List

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ArrayList<TypeDescription>

Constructor Summary

AccessConstructor and Description
private
List()

Method Summary

Modifier and TypeMethod and Description
public void
public TypeDescription[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

listback to summary
private final ArrayList<TypeDescription> list

Constructor Detail

Listback to summary
private List()

Method Detail

addback to summary
public void add(TypeDescription desc)
toArrayback to summary
public TypeDescription[] toArray()