Class ByDeclaredName

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

@OpenApiAll public class ByDeclaredName extends com.dassault_systemes.modeler.kerml.find.AbstractFinder
Finder implementation that locates elements by their declared name within the directly owned members of a given context.

This finder performs a non-recursive search, considering only elements that are immediately owned by the provided context. The declared name refers to the explicit name defined in the model.

  • Constructor Details

    • ByDeclaredName

      public ByDeclaredName()
  • Method Details

    • find

      @CheckForNull public <T extends Element> T find(Element context, String name, Class<T> metaclass)
      Finds a single element with the specified declared name and type.
      Type Parameters:
      T - the element type
      Parameters:
      context - the element whose direct owned elements are searched
      name - the declared name to match
      metaclass - the expected type of the result
      Returns:
      the matching element, or null if no match is found