Class AbstractByQualifiedNameFinder<R extends com.nomagic.uml2.project.ElementProject>

java.lang.Object
com.nomagic.uml2.finder.BaseFinder
com.nomagic.uml2.finder.AbstractByQualifiedNameFinder<R>
Direct Known Subclasses:
Finder.ByQualifiedNameFinder

@OpenApiAll public abstract class AbstractByQualifiedNameFinder<R extends com.nomagic.uml2.project.ElementProject> extends com.nomagic.uml2.finder.BaseFinder
Search for elements by qualified name
  • Field Details

  • Constructor Details

    • AbstractByQualifiedNameFinder

      public AbstractByQualifiedNameFinder()
  • Method Details

    • find

      @CheckForNull public <T extends Element> T find(R elementProject, String qualifiedName)
      Find Element with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      Returns:
      Element or null
    • findIgnoreCase

      @CheckForNull public <T extends Element> T findIgnoreCase(R elementProject, String qualifiedName)
      Find Element with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      Returns:
      Element or null
    • find

      @CheckForNull public <T extends Element> T find(R elementProject, String qualifiedName, @CheckForNull Class<? extends Element> type)
      Finds element with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      type - strict class type of element. Null mean any type.
      Returns:
      Element or null
    • find

      @CheckForNull public <T extends Element> T find(R elementProject, String qualifiedName, @CheckForNull Class[] types)
      Finds element with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      types - strict class type of element. Null mean any type.
      Returns:
      Element or null
    • find

      @CheckForNull public <T extends Element> T find(Collection<? extends Element> parents, String qualifiedName, @CheckForNull Class[] types)
      Finds element with a given qualified name.
      Parameters:
      parents - root elements to start search from
      qualifiedName - qualified name of Element
      types - strict class type of element. Null mean any type.
      Returns:
      Element or null
    • find

      public <T extends Element> Collection<T> find(R elementProject, String qualifiedName, @CheckForNull Class<? extends Element> type, boolean searchJustOne)
      Finds elements with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      type - strict class type of element. Null mean any type
      searchJustOne - stop search if one element is found
      Returns:
      all elements with a given qualified name
    • findIgnoreCase

      public <T extends Element> Collection<T> findIgnoreCase(R elementProject, String qualifiedName, @CheckForNull Class[] type, boolean searchJustOne)
      Finds elements with a given qualified name but ignores lower and upper cases.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      type - strict class type of element. Null mean any type
      searchJustOne - stop search if one element is found
      Returns:
      all elements with a given qualified name with ignored lower and upper cases.
    • find

      public <T extends Element> Collection<T> find(R elementProject, String qualifiedName, @CheckForNull Class[] type, boolean searchJustOne)
      Finds elements with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      type - strict class type of element. Null mean any type
      searchJustOne - stop search if one element is found
      Returns:
      all elements with a given qualified name
    • find

      public <T extends Element> Collection<T> find(R elementProject, String qualifiedName, @CheckForNull Class[] types, boolean searchJustOne, BiPredicate<String,String> compareBiPredicate)
      Finds elements with a given qualified name.
      Parameters:
      elementProject - provides root elements to start search from
      qualifiedName - qualified name of Element
      types - strict class types of element. Null mean any types
      searchJustOne - stop search if one element is found
      compareBiPredicate - check for element naming
      Returns:
      all elements with a given qualified name
    • find

      public <T extends Element> Collection<T> find(Collection<? extends Element> parents, String qualifiedName, @CheckForNull Class[] types, boolean searchJustOne, BiPredicate<String,String> compareBiPredicate)
      Finds elements with a given qualified name.
      Parameters:
      parents - root elements to start search from
      qualifiedName - qualified name of Element
      types - strict class types of element. Null mean any types
      searchJustOne - stop search if one element is found
      compareBiPredicate - check for element naming
      Returns:
      all elements with a given qualified name
    • isMatchingElement

      public <T extends Element> boolean isMatchingElement(BiPredicate<String,String> compareBiPredicate, Collection<String> pathElements, @CheckForNull Collection<Class<T>> typeSet, int i, String name, Element el)
    • isFinalPartOfQualifiedName

      public boolean isFinalPartOfQualifiedName(Collection<String> pathElements, int i)
    • findRelative

      @CheckForNull public <T extends Element> T findRelative(Element root, String qualifiedName, @CheckForNull Class<? extends Element> type)
      Search is done in a given scope (root Element) by searching for an element with a given partial qualified name.
      Parameters:
      root - scope Element
      qualifiedName - qualified name of element
      type - strict class type of element. Nulls means any element
      Returns:
      Element or null
    • findRelative

      @CheckForNull public <T extends Element> T findRelative(Element root, String qualifiedName, @CheckForNull Class[] type)
      Search is done in a given scope (root Element) by searching for an element with a given partial qualified name.
      Parameters:
      root - scope Element
      qualifiedName - qualified name of element
      type - strict class type of element. Nulls means any element
      Returns:
      Element or null
    • splitQualifiedName

      public static List<String> splitQualifiedName(String qualifiedName)