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

  • 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 Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String PACKAGE_SEPARATOR  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <T extends Element>
      T
      find​(java.util.Collection<? extends Element> parents, java.lang.String qualifiedName, java.lang.Class[] types)
      Finds element with a given qualified name.
      <T extends Element>
      java.util.Collection<T>
      find​(java.util.Collection<? extends Element> parents, java.lang.String qualifiedName, java.lang.Class[] types, boolean searchJustOne, java.util.function.BiPredicate<java.lang.String,​java.lang.String> compareBiPredicate)
      Finds elements with a given qualified name.
      <T extends Element>
      T
      find​(R elementProject, java.lang.String qualifiedName)
      Find Element with a given qualified name.
      <T extends Element>
      T
      find​(R elementProject, java.lang.String qualifiedName, java.lang.Class[] types)
      Finds element with a given qualified name.
      <T extends Element>
      java.util.Collection<T>
      find​(R elementProject, java.lang.String qualifiedName, java.lang.Class[] type, boolean searchJustOne)
      Finds elements with a given qualified name.
      <T extends Element>
      java.util.Collection<T>
      find​(R elementProject, java.lang.String qualifiedName, java.lang.Class[] types, boolean searchJustOne, java.util.function.BiPredicate<java.lang.String,​java.lang.String> compareBiPredicate)
      Finds elements with a given qualified name.
      <T extends Element>
      T
      find​(R elementProject, java.lang.String qualifiedName, java.lang.Class<? extends Element> type)
      Finds element with a given qualified name.
      <T extends Element>
      java.util.Collection<T>
      find​(R elementProject, java.lang.String qualifiedName, java.lang.Class<? extends Element> type, boolean searchJustOne)
      Finds elements with a given qualified name.
      <T extends Element>
      T
      findIgnoreCase​(R elementProject, java.lang.String qualifiedName)
      Find Element with a given qualified name.
      <T extends Element>
      java.util.Collection<T>
      findIgnoreCase​(R elementProject, java.lang.String qualifiedName, java.lang.Class[] type, boolean searchJustOne)
      Finds elements with a given qualified name but ignores lower and upper cases.
      <T extends Element>
      T
      findRelative​(Element root, java.lang.String qualifiedName, java.lang.Class[] type)
      Search is done in a given scope (root Element) by searching for an element with a given partial qualified name.
      <T extends Element>
      T
      findRelative​(Element root, java.lang.String qualifiedName, java.lang.Class<? extends Element> type)
      Search is done in a given scope (root Element) by searching for an element with a given partial qualified name.
      boolean isFinalPartOfQualifiedName​(java.util.Collection<java.lang.String> pathElements, int i)  
      <T extends Element>
      boolean
      isMatchingElement​(java.util.function.BiPredicate<java.lang.String,​java.lang.String> compareBiPredicate, java.util.Collection<java.lang.String> pathElements, java.util.Collection<java.lang.Class<T>> typeSet, int i, java.lang.String name, Element el)  
      static java.util.List<java.lang.String> splitQualifiedName​(java.lang.String qualifiedName)  
      • Methods inherited from class com.nomagic.uml2.finder.BaseFinder

        hasName, toRoots, toRoots, toSet, toTypes
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PACKAGE_SEPARATOR

        public static final java.lang.String PACKAGE_SEPARATOR
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractByQualifiedNameFinder

        public AbstractByQualifiedNameFinder()
    • Method Detail

      • find

        @CheckForNull
        public <T extends Element> T find​(R elementProject,
                                          java.lang.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,
                                                    java.lang.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,
                                          java.lang.String qualifiedName,
                                          @CheckForNull
                                          java.lang.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,
                                          java.lang.String qualifiedName,
                                          @CheckForNull
                                          java.lang.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​(java.util.Collection<? extends Element> parents,
                                          java.lang.String qualifiedName,
                                          @CheckForNull
                                          java.lang.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> java.util.Collection<T> find​(R elementProject,
                                                                java.lang.String qualifiedName,
                                                                @CheckForNull
                                                                java.lang.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> java.util.Collection<T> findIgnoreCase​(R elementProject,
                                                                          java.lang.String qualifiedName,
                                                                          @CheckForNull
                                                                          java.lang.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> java.util.Collection<T> find​(R elementProject,
                                                                java.lang.String qualifiedName,
                                                                @CheckForNull
                                                                java.lang.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> java.util.Collection<T> find​(R elementProject,
                                                                java.lang.String qualifiedName,
                                                                @CheckForNull
                                                                java.lang.Class[] types,
                                                                boolean searchJustOne,
                                                                java.util.function.BiPredicate<java.lang.String,​java.lang.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> java.util.Collection<T> find​(java.util.Collection<? extends Element> parents,
                                                                java.lang.String qualifiedName,
                                                                @CheckForNull
                                                                java.lang.Class[] types,
                                                                boolean searchJustOne,
                                                                java.util.function.BiPredicate<java.lang.String,​java.lang.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​(java.util.function.BiPredicate<java.lang.String,​java.lang.String> compareBiPredicate,
                                                             java.util.Collection<java.lang.String> pathElements,
                                                             @CheckForNull
                                                             java.util.Collection<java.lang.Class<T>> typeSet,
                                                             int i,
                                                             java.lang.String name,
                                                             Element el)
      • isFinalPartOfQualifiedName

        public boolean isFinalPartOfQualifiedName​(java.util.Collection<java.lang.String> pathElements,
                                                  int i)
      • findRelative

        @CheckForNull
        public <T extends Element> T findRelative​(Element root,
                                                  java.lang.String qualifiedName,
                                                  @CheckForNull
                                                  java.lang.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,
                                                  java.lang.String qualifiedName,
                                                  @CheckForNull
                                                  java.lang.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 java.util.List<java.lang.String> splitQualifiedName​(java.lang.String qualifiedName)