Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Method Class

A method represents a UML operation. It is accessed from the Element Methods collection and includes collections for parameters, constraints and Tagged Values.

Associated table in .EAP file: t_operation

Method Attributes

Attribute

Type

Notes

Abstract

Boolean

Read/Write. Flag indicating if the method is abstract (1) or not (0).

Behavior

String

Read/Write. Some further explanatory behavior notes (for example, pseudocode).

In earlier releases of Enterprise Architect this attribute had the UK/Australian spelling 'Behaviour'; this is still present for backwards compatibility, but please now use the 'Behavior' attribute for consistency.

ClassifierID

String

Read/Write. Classifier ID that applies to the ReturnType.

Code

String

Read/Write. Optional field to hold the method Code (used for the Initial Code field).

Concurrency

Variant

Read/Write. Concurrency type of method.

IsConst

Boolean

Read/Write. Flag indicating the method is Const.

IsLeaf

Boolean

Read/Write. Flag to indicate if the method is Leaf (cannot be overridden).

IsPure

Boolean

Read/Write. Flag indicating the method is defined as Pure in C++.

IsQuery

Boolean

Read/Write. Flag to indicate if the method is a query (that is, does not alter Class variables).

IsRoot

Boolean

Read/Write. Flag to indicate if the method is Root.

IsStatic

Boolean

Read/Write. Flag to indicate a static method.

IsSynchronized

Boolean

Read/Write. Flag indicating a Synchronized method call.

MethodGUID

String

Read/Write. A globally unique ID for the current method. System generated.

MethodID

Long

Read only. A local ID for the current method, only valid within this .EAP file.

Name

String

Read/Write. The method name.

Notes

String

Read/Write. Descriptive notes about the method.

ObjectType

ObjectType

Read only. Distinguishes objects referenced through a Dispatch interface.

Parameters

Collection

Read only. The Parameters collection for the current method. Use to add and access parameter objects for the current method.

ParentID

Long

Read only. Returns the ElementID of the element that this method belongs to.

Pos

Long

Read/Write. Specifies the position of the method within the set of operations defined for a Class.

PostConditions

Collection

Read only. PostConditions (constraints) as they apply to this method. Returns a MethodConstraint object of type post.

PreConditions

Collection

Read only. PreConditions (constraints) as they apply to this method. Returns a MethodConstraint object of type pre.

ReturnIsArray

Boolean

Read/Write. Flag to indicate the return value is an array.

ReturnType

String

Read/Write. Return type for the method; can be a primitive data type or a Class or Interface type.

StateFlags

String

Read/Write. Some flags as applied to methods in State elements.

Stereotype

String

Read/Write. The method stereotype (optional).

StereotypeEx

String

Read/Write. All the applied stereotypes of the method in a comma-separated list.

Style

String

Read/Write. Contains the Alias property for this method.

StyleEx

String

Read/Write. Advanced style settings. Reserved for the use of Sparx Systems.

TaggedValues

Collection of type MethodTag

Read only. TaggedValues collection for the current method. Accesses a list of MethodTag objects.

Throws

String

Read/Write. Exception information.

Visibility

String

Read/Write. The method scope: Public, Protected, Private or Package.

Method Methods

Method

Type

Notes

GetLastError ()

String

Returns a string value describing the most recent error that occurred in relation to this object.

This function is rarely used as an exception is thrown when an error occurs.

Update ()

Boolean

Update the current method object after modification or appending a new item. If false is returned, check the GetLastError function for more information.