Libraries anvil runtime Type

class Type
extends anvil.lang.object
Type is a generic representation of all the entities declared with anvil.

Constants

constant CLASS

constant CONSTANT_VARIABLE

constant CONSTRUCTOR

constant FUNCTION

constant FUNCTION_PARAMETER

constant GLOBAL_NAMESPACE

constant IMPORT

constant INTERFACE

constant INTERFACE_METHOD

constant LOCAL_VARIABLE

constant MEMBER_VARIABLE

constant METHOD

constant MODULE

constant NAMESPACE

constant STATIC_VARIABLE

constant SYSTEM_NAMESPACE


Methods

Type getBaseClass()
Returns the base class of this class.

Type getClass()
Returns the class where this type is declared.

Function getConstructor()
Returns the constructor of class.

array getDeclarations()
array getDeclarations(string type)
array getDeclarations(int type)
Returns array of declarations contained in this type. Declarations are mapped to array their names.
Parameters type -  Optional parameter restricting returned declarations to be of given type.

Doc getDoc()
Returns a document for this type.

Function getFunction()
Returns this function as anvil.runtime.Function.

tuple getInterfaces()
Returns the tuple of interfaces of this class or interfaces.

Type getModule()
Returns the script where this type is declared.

string getName()
Returns the name of type.

array getParameterList()
Returns array containing a function's parameters list. For each parameter there exists an tuple (required, defaultValue, docText, docTypeText). These tuples are mapped to array with parameters names. If parameter name is .. it indicates that this function accepts variable length arguments and mapped tuple contains (restName, docText, docTypeText).

Scope getParent()
Returns the parent type for this type.

string getPathinfo()
Returns the pathinfo where this type is declared. If it is located on a library, returns the name of library.

string getQualifiedName()
Returns the qualified name (dotted name starting from module) of type.

string getType()
Returns the type as string. Type is one of:

int getTypeCode()
Returns type as int.

URL getURL()
Returns the url where this type is declared. If it is located on a library, undefined.

object getValue()
object getValue(object instance)
Returns the value contained in variable.
Parameters instance -  Instance of class, required if the type is a member variable

Configurable getZone()
Returns the Zone where this type is declared.
Throws AccessDenied -  If security policy denies this operation.

boolean hasDoc()
Checks if this type has a document.

boolean isInstanceOf(Type type)
Checks if this type a super class or same as the given type.

boolean isPrivate()
Checks if this type is private.

Type lookup(string name)
Looks up declaration with given name.
Returns Type or undefined, if there was not a declaration with that name

Type lookupInherited(string name)
Looks up inherited declaration with given name from class or interface.
Returns Type or undefined, if there was not a declaration with that name

object newInstance(parameters...)
Creates and returns a new instance from class with given parameters.

object setValue(object value)
object setValue(object value, object instance)
Sets the value contained in variable.
Parameters instance -  Instance of class, required if the type is a member variable