Class Finder

java.lang.Object
com.nomagic.uml2.finder.BaseFinder
com.nomagic.magicdraw.uml.Finder

@OpenApiAll public class Finder extends com.nomagic.uml2.finder.BaseFinder
This utility class should be used for searching element(s) in the model using various criteria. Search criteria are organized in several inner finders.


To retrieve Element metatype, use BaseElement.getClassType()

Use ClassTypes.getSubtypesArray(Class) to collect all subtypes as array of given metatype


Use methods below to get instances of these finders:
  • Constructor Details

    • Finder

      public Finder()
  • Method Details

    • byName

      public static Finder.ByNameFinder byName()
      Search for any first element by simple name among the given root element(s) and direct children of root element(s)
      Returns:
      finder by element name
    • byNameAll

      public static Finder.ByNameAllFinder byNameAll()
      Search for all elements by simple name among the given root element(s) and direct children of root element(s)
      Returns:
      finder of all elements by name
    • byNameRecursively

      public static Finder.ByNameRecursivelyFinder byNameRecursively()
      Search for any first element by simple name among the given root element(s) and all(direct and indirect) children of root element(s)
      Returns:
      finder by element name recursively
    • byNameAllRecursively

      public static Finder.ByNameAllRecursivelyFinder byNameAllRecursively()
      Search for all elements by simple name among the given root element(s) and all(direct and indirect) children of root element(s)
      Returns:
      finder of all elements recursively
    • byQualifiedName

      public static Finder.ByQualifiedNameFinder byQualifiedName()
      Search for elements by qualified name
      Returns:
      finder by qualified name
    • byHyperlink

      public static Finder.ByHyperlinkFinder byHyperlink()
      Search for elements by element hyperlink.
      Returns:
      finder by qualified name
    • byType

      public static Finder.ByTypeFinder byType()
      Search for all elements by element type in the given root element(s) and direct children of root element(s)
      Returns:
      finder by element meta type
    • byTypeRecursively

      public static Finder.ByTypeRecursivelyFinder byTypeRecursively()
      Search for all elements by element type in the given root element(s) and all(direct and indirect) children of root element(s)
      Returns:
      finder by element metatype recursively
    • byScope

      public static Finder.ByScopeFinder byScope()
      Search for all elements in the given root element(s) and all(direct and indirect) children of root element(s)
      Returns:
      finder by scope