136715159
MD2024x
3
Versions Compared
compared with
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Use com.nomagic.magicdraw.uml.Finder for finding elements by the name or type (meta-type) in a project. This utility class provides several internal finders for executing different types of search operations.
For example:
Code Block | ||
---|---|---|
| ||
Project project = ...; //find a Model element under the project primary model with a name "MyModel". It is not a recursive search Model model = Finder.byName().find(project.getPrimaryModel(), Model.class, "MyModel"); //find a first Model element under project primary model with a name "MyModel". It is a recursive search. Model model = Finder.byNameRecursively().find(project.getPrimaryModel(), Model.class, "MyModel"); //find all Model elements under project primary model with a name "MyModel". It is a recursive search. Collection<Model> models = Finder.byNameAllRecursively().find(project.getPrimaryModel(), Model.class, "MyModel"); |
Finding or creating Classifiers
A special utility class is available for search or creating Classifiers by metatype, simple or qualified name - com.nomagic.magicdraw.uml.ClassifierFinder