MDWList APIs

A list of model elements is represented by the interface MDWList, which is an sub interface of java.util.List. It provides facilities to invoke scripts on each model element of this list.

MDWList enables to :

Examples

Let's take an MDWList containing UML classes Customer, Bank and Account

Concatenates the name of each Class:

myList.concat("name")
// output example: "CustomerBankAccount"

Concatenates the name of each Class, separated by a comma:

myList.concat("name", ", ")
// output example: "Customer, Bank, Account"

Creates an MDWList of each Feature of each Class:

myList.collect("feature")
// output example: [name, address, zipcode, number]

Concatenates the name each Feature of each Class, separated by a comma:

myList.collect("feature").concat("name", ", ")
// output example: "name, address, zipcode, number"

Gets the feature named "zipcode":

myList.collect("feature").detect("name", "zipcode")
// output: zipcode

Gets the non-abstract classes:

myList.select("isAbstract", Boolean.FALSE)
// output example: [Customer, Account]

Concatenates the name of each Class, separated by a comma and sorted by name:

myList.sort("name").concat("name", ", ")
// output example: "Account, Bank, Customer"