Breadcrumbs

staticTypeOf() Operation

Syntax

set type = anyObject.staticTypeOf();

Semantics

Returns the type of any object it has had at compile-time. To get the type the object has at run-time use the /wiki/spaces/BRIDGE/pages/19268744. typeOf() and staticTypeOf() may return the same type, though.

Substitutables

type

Can be any variable or object attribute having the type String

anyObject

Can be any object.

Examples

Assume you have the following class structure:

action_language_statictypeof_classes.png

A type Customer derives from a type Person and adds an additional attribute.

Now assume further you have an object of each class (aPerson and aCustomer) and the following action script:

set aPerson = aCustomer;
set staticTypeOfaPerson = aPerson.staticTypeOf();
set typeOfaPerson = aPerson.typeOf();

typeOfaPerson will be Customer, staticTypeOfaPerson will be Person, which is the type the object had originally been created with.

Find below a list of all Bridge Base Types together with their type string as returned by typeOf() and staticTypeOf().Bridge Base TypeType StringAnyurn:Base_Types.AnyArrayurn:Base_Types.ArrayBloburn:Base_Types.BlobBooleanurn:Base_Types.BooleanDateTimeurn:Base_Types.DateTimeFloaturn:Base_Types.FloatIntegerurn:Base_Types.IntegerStringurn:Base_Types.StringOther, e.g. model specific, types can be referenced via their path in the containment tree, e.g. a class customer that has been defined in the UML package Services/TypeOperationsService/Classes/Customer would have the following type string:"urn:Services.TypeOperationsService.Classes.Customer".



icon_download_example.png

<your example path>\Basic Modeling\ClassOperation\uml\typeOperations.xml



Related Pages: