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
Fields Modifier and Type Field Description static java.lang.String
PACKAGE_SEPARATOR
-
Constructor Summary
Constructors Constructor Description AbstractByQualifiedNameFinder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends Element>
Tfind(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>
Tfind(R elementProject, java.lang.String qualifiedName)
Find Element with a given qualified name.<T extends Element>
Tfind(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>
Tfind(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>
TfindIgnoreCase(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>
TfindRelative(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>
TfindRelative(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>
booleanisMatchingElement(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)
-
-
-
Field Detail
-
PACKAGE_SEPARATOR
public static final java.lang.String PACKAGE_SEPARATOR
- See Also:
- Constant Field Values
-
-
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 fromqualifiedName
- 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 fromqualifiedName
- 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 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, java.lang.String qualifiedName, @CheckForNull java.lang.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(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 fromqualifiedName
- qualified name of Elementtypes
- 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 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> 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 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> 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 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> 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 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> 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 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(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 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, 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 ElementqualifiedName
- qualified name of elementtype
- 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)
-
-