Package com.nomagic.uml2.finder
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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T extends Element>
Tfind
(Collection<? extends Element> parents, String qualifiedName, Class[] types) Finds element with a given qualified name.<T extends Element>
Collection<T>find
(Collection<? extends Element> parents, String qualifiedName, Class[] types, boolean searchJustOne, BiPredicate<String, String> compareBiPredicate) Finds elements with a given qualified name.<T extends Element>
TFind Element with a given qualified name.<T extends Element>
TFinds element with a given qualified name.<T extends Element>
Collection<T>Finds elements with a given qualified name.<T extends Element>
Collection<T>find
(R elementProject, String qualifiedName, Class[] types, boolean searchJustOne, BiPredicate<String, String> compareBiPredicate) Finds elements with a given qualified name.<T extends Element>
TFinds element with a given qualified name.<T extends Element>
Collection<T>Finds elements with a given qualified name.<T extends Element>
TfindIgnoreCase
(R elementProject, String qualifiedName) Find Element with a given qualified name.<T extends Element>
Collection<T>findIgnoreCase
(R elementProject, String qualifiedName, Class[] type, boolean searchJustOne) Finds elements with a given qualified name but ignores lower and upper cases.<T extends Element>
TfindRelative
(Element root, String qualifiedName, 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>
TfindRelative
(Element root, String qualifiedName, 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
(Collection<String> pathElements, int i) <T extends Element>
booleanisMatchingElement
(BiPredicate<String, String> compareBiPredicate, Collection<String> pathElements, Collection<Class<T>> typeSet, int i, String name, Element el) splitQualifiedName
(String qualifiedName) Methods inherited from class com.nomagic.uml2.finder.BaseFinder
hasName, toRoots, toRoots, toSet, toTypes
-
Field Details
-
PACKAGE_SEPARATOR
- See Also:
-
-
Constructor Details
-
AbstractByQualifiedNameFinder
public AbstractByQualifiedNameFinder()
-
-
Method Details
-
find
Find Element with a given qualified name.- Parameters:
elementProject
- provides root elements to start search fromqualifiedName
- qualified name of Element- Returns:
- Element or null
-
findIgnoreCase
Find Element with a given qualified name.- Parameters:
elementProject
- provides root elements to start search fromqualifiedName
- 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 fromqualifiedName
- qualified name of Elementtype
- 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 fromqualifiedName
- qualified name of Elementtypes
- 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 fromqualifiedName
- qualified name of Elementtypes
- 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 fromqualifiedName
- qualified name of Elementtype
- strict class type of element. Null mean any typesearchJustOne
- 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 fromqualifiedName
- qualified name of Elementtype
- strict class type of element. Null mean any typesearchJustOne
- 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 fromqualifiedName
- qualified name of Elementtype
- strict class type of element. Null mean any typesearchJustOne
- 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 fromqualifiedName
- qualified name of Elementtypes
- strict class types of element. Null mean any typessearchJustOne
- stop search if one element is foundcompareBiPredicate
- 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 fromqualifiedName
- qualified name of Elementtypes
- strict class types of element. Null mean any typessearchJustOne
- stop search if one element is foundcompareBiPredicate
- 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
-
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 ElementqualifiedName
- qualified name of elementtype
- 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 ElementqualifiedName
- qualified name of elementtype
- strict class type of element. Nulls means any element- Returns:
- Element or null
-
splitQualifiedName
-