documentation.lsfusion.org will be shutting down soon, use https://docs.lsfusion.org instead please.

Skip to end of metadata
Go to start of metadata

The EXTEND CLASS instruction extends an existing class.

Syntax

EXTEND CLASS name 
[{
	objectName1 [objectCaption1],
	...
	objectNameM [objectCaptionM]
}] 
[: parent1, ..., parentN];

Description

The EXTEND CLASS instruction extends an existing custom class with additional parent classes and newstatic objects. You can also extend abstract classes by adding parent classes to them.

Parameters

name 

Class name. A Composite ID

objectName1, ..., objectNameM

Names of new static objects of the specified class. Each name is defined by a simple ID. Name values are stored in the System.staticName system property.

objectCaption1, ..., objectCaptionM

Captions of new static objects of the specified class. Each caption is a string literal. If the caption is not defined, the name of the static object will be its caption. Caption values are stored in the System.staticCaption system property.

parent1, ..., parentN

A list of names of new parent classes. Each name is defined by a composite ID. 

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 CLASS ABSTRACT Shape;
CLASS Box : Shape;

CLASS Quadrilateral;
EXTEND CLASS Box : Quadrilateral; // Adding inheritance

CLASS ShapeType {
	point 'Dot',
	segment 'Line segment'
} 
 
EXTEND CLASS ShapeType { // Adding a static object
	circle 'Circle'
}

  • No labels