This repository was archived by the owner on Mar 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
SelectorExpression
niklauslee edited this page Jan 4, 2015
·
1 revision
Selector expression is an query to select elements in a model file (.mdj).
var repo = app.getModule("core/Repository");
...
var elems1 = repo.select("Package1::@UMLClass.attributes[type=String]");
var elems2 = repo.select("Package1::Model1::@UMLInterface.operations[isAbstract=false]");Select elements which has name specified by N. (equivalent to value selector [name=N])
Examples
-
Class1: "Class1" elements (all element named by "Class1"). -
Class1::Attribute1: all elements named by "Attribute1" only in children of "Class1" element(s).
Select all child elements of an element P.
Examples
-
Package1::: all children of "Package1" element(s). -
Package1::@UMLClass: all elements of type "UMLClass" only in children of "Package1" element(s).
Select all elements of type T.
Examples
-
@UMLInterface: all elements of type "UMLInterface". -
@UMLClassifier: all elements of type "UMLClassifier". (includes all descendants types: e.g. UMLClass, UMLInterface, UMLEnumeration, ...) -
Package1::@UMLClass: all elements of type "UMLClass" only in children of "Package1" element(s).
Select all elements contained in field F.
Examples
-
Class1.attributes: all attribute elements contained inattributesfield of "Class1" element(s). -
Package1.ownedElements: all elements contained inownedElementsfield of "Package1" element(s). -
@UMLClass.operations: all operation elements contained inoperationsfield for all elements of type "UMLClass".
Select all elements whose field F has value V.
Examples
-
Class1.operations[isAbstract=false]: All non-abstract (isAbstract=false) operations of "Class1" element(s). -
Class1.attributes[isDerived=true]: All derived attribute (isDerived=true) elements of "Class1" element(s).