TypeInfo CLASS

This class contains only the most basic information about a type found in a module or script file.

This class is always instantiated by the system based on the scanning result of script files. The fact that an instance of TypeInfo for certain type exists doesn't guarantee that the corresponding Type would be successfully loaded should such attempt be made. This is because the scanning operation to extract the basic information is only performing syntax check and very limited semantic check. The user must proceed to call load() to actually verify and load the type into the runtime.

Parent Class

All Members


TypeNameSignature
methodgetFullNamepublic String getFullName()
methodgetModuleNamepublic String getModuleName()
methodgetSimpleNamepublic String getSimpleName()
methodisClasspublic bool isClass()
methodisInterfacepublic bool isInterface()
methodloadpublic Type load()

Methods


public String getFullName()

Get the fully qualified type name. This will always return canonical name, not language-level alias for certain built-in types.

Returns

  • The fully qualified type name.

public String getModuleName()

Get the module name of this type, i.e. excluding the part for module. For a type with fully qualified name "A.B.C", this method will return "A.B".

Returns

  • The module name. For some built-in types which do not have a module this returns null.

public String getSimpleName()

Get the simple name of this type, i.e. excluding the part for module. For a type with fully qualified name "A.B.C", this method will return "C". This will always return canonical name, not language-level alias for certain built-in types.

Returns

  • The simple type name. For some built-in types this name is same to full name returned by getFullName().

public bool isClass()

Check whether the type is a class type. Interface types, primitive types, Any and Void type is not class type; all the other are.

Returns

  • True if this type is a class type, inheriting, or exactly is, Object.

public bool isInterface()

Check whether the type is an interface type.

Returns

  • True if this type is an interface type.

public Type load()

Load this type into the runtime.

Returns

  • The Type instance for this type.