Class ByQualifiedName

java.lang.Object
com.dassault_systemes.modeler.kerml.find.AbstractFinder
com.dassault_systemes.modeler.kerml.find.ByQualifiedName

@OpenApiAll public class ByQualifiedName extends com.dassault_systemes.modeler.kerml.find.AbstractFinder
Finder implementation that resolves elements by their qualified name within a model context.

A qualified name represents the hierarchical path to an element, typically composed of nested namespace or package names separated by a delimiter (e.g., "::"). This allows unambiguous identification of elements across different scopes.

  • Constructor Details

    • ByQualifiedName

      public ByQualifiedName()
  • Method Details

    • find

      @CheckForNull public <T extends Element> T find(Element context, String qualifiedName, Class<T> metaclass)
      Finds a single element matching the given qualified name and metaclass.
      Type Parameters:
      T - the element type
      Parameters:
      context - the starting element (e.g., namespace or root) from which the qualified name is resolved
      qualifiedName - the fully qualified name identifying the target element
      metaclass - the expected type of the result
      Returns:
      the matching element, or null if no match is found
    • findAll

      public <T extends Element> Collection<T> findAll(Element context, String qualifiedName, Class<T> metaclass)
      Finds all elements matching the given qualified name and metaclass.
      Type Parameters:
      T - the element type
      Parameters:
      context - the starting element from which resolution begins
      qualifiedName - the fully qualified name identifying target elements
      metaclass - the expected type of the results
      Returns:
      a collection of matching elements, possibly empty but never null