Tests if the specified element complies with one of the specified Element Types.

Note: Since in some DSMs (Data Source Models) there is no direct inherent association between elements and Element Types, testing if an element complies with a certain Element Type can be done much quicker than finding the exact Element Type associated with this element. When you need only to test if some element belongs to a certain Element Type, always use this function instead of the GOMElement.elementType property.

Parameters:

element

The element to be tested. If not specified, the generator context element will be assumed, i.e. the same as the call: contextElement.instanceOf(elementTypeSpec)
elementTypeSpec
The list of the Element Types (see "Specifying Matching Element Types" below).

Returns:

true if the element complies with at least one of the specified Element Types;
false otherwise (or in the case element == null)

See Also:

checkElementType(), resolveElementType(), findElementType(), GOMElement.elementType
Tip:

You may call this function in a method-like style, e.g.:


element.instanceOf("UseCase")
element.instanceOf("Class | Interface")

${include ../../../refs/matching_ets_spec.htm}

${include ../../../refs/element_types.htm}