@OpenApiAll
public class ClassifierFinder
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ClassifierFinder.SimpleNameResolver
A resolver of simple classifier name.
|
Constructor and Description |
---|
ClassifierFinder() |
Modifier and Type | Method and Description |
---|---|
static Classifier |
createClassifier(java.lang.String elementName,
java.lang.Class type,
java.util.List suggestedByDSL,
Namespace root) |
static Classifier |
createClassifier(java.lang.String qualifiedName,
java.lang.Class type,
Namespace root)
Creates a classifier and packages for classifier according qualified classifier name.
|
static Classifier |
findClassifier(Project project,
java.lang.String name,
java.lang.Class[] types,
java.util.Collection restricted,
Namespace root)
Looks for a classifier by a given name (simple or qualified).
|
static Classifier |
findClassifier(java.lang.String name,
java.lang.Class[] types,
java.util.Collection restricted,
java.util.List<Namespace> root)
Looks for a classifier of type by a given name (simple or qualified)
|
static Classifier |
findClassifierOrDataType(Project project,
java.lang.String name,
java.lang.Class[] types,
java.util.Collection restricted,
Namespace root)
Looks for a classifier of type or standard data type by a given name (simple or qualified).
|
static Classifier |
findClassifierOrDataType(Project project,
java.lang.String name,
java.util.Collection restricted,
Namespace root)
Looks for a classifier or standard data type by the given name (simple or qualified).
|
static Classifier |
findOrCreateClassifier(Project project,
Element context,
java.lang.String name,
java.lang.Class createType)
Searches for a classifier or standard data type with a given name (qualified or simple).
|
static Classifier |
findOrCreateClassifier(Project project,
Element context,
java.lang.String name,
java.lang.Class createType,
java.util.Collection<java.lang.Class> searchType,
ClassifierFinder.SimpleNameResolver simpleNameResolver)
Searches for a classifier or standard data type with a given name (qualified or simple)
|
static Classifier |
findOrCreateClassifier(Project project,
Element context,
java.lang.String name,
java.lang.Class createType,
java.util.Collection<java.lang.Class> searchType,
ClassifierFinder.SimpleNameResolver simpleNameResolver,
boolean createIfNotFound)
Searches for a classifier or standard data type with a given name (qualified or simple)
|
static Classifier |
findOrCreateClassifier(Project project,
Element context,
java.lang.String name,
java.lang.Class createType,
java.util.Collection<java.lang.Class> searchType,
ClassifierFinder.SimpleNameResolver simpleNameResolver,
boolean createIfNotFound,
PresentationElement contextView)
Searches for a classifier with given name (simple or qualified).
|
static Classifier |
findOrCreateClassifier(Project project,
Element context,
java.lang.String name,
ClassifierFinder.SimpleNameResolver simpleNameResolver)
Searches for a classifier or standard data type with a given name (qualified or simple).
|
static Classifier |
findOrCreateClassifier(Project project,
Element context,
java.lang.String name,
ClassifierFinder.SimpleNameResolver simpleNameResolver,
boolean createIfNotFound)
Searches for a classifier or standard data type with a given name (qualified or simple).
|
static Namespace |
findOrCreateNamespaceForElement(java.lang.String qualifiedElementName,
java.lang.Class searchType,
java.lang.Class createType,
Namespace root)
Returns namespace according given qualified element name.
|
static Namespace |
findOrCreatePackageForElement(java.lang.String qualifiedElementName,
Namespace root)
Creates or finds packages using a qualified name of element in the given root.
|
static Classifier |
findStandardDataType(Project project,
java.lang.String name,
java.util.Collection restricted)
Searches for a standard DataType from UMLStandardProfile or MagicDrawProfile modules.
|
static boolean |
isQualifiedName(java.lang.String elementName)
Check if given element name is a qualified name
|
@CheckForNull public static Classifier findClassifier(Project project, java.lang.String name, @CheckForNull java.lang.Class[] types, @CheckForNull java.util.Collection restricted, @CheckForNull Namespace root)
project
- projectname
- classifier name (simple or qualified)types
- classifier typesrestricted
- allowed DSL elements. Collection should contain stereotypes and/or metaclass classes (java.lang.Class)root
- root element. Null means whole project@CheckForNull public static Classifier findClassifier(java.lang.String name, @CheckForNull java.lang.Class[] types, @CheckForNull java.util.Collection restricted, java.util.List<Namespace> root)
name
- classifier name (simple or qualified)types
- classifier typesrestricted
- allowed DSL elements. Collection should contain stereotypes and/or metaclass classes (java.lang.Class)root
- root elements. Empty means whole project@CheckForNull public static Classifier findStandardDataType(Project project, java.lang.String name, @CheckForNull java.util.Collection restricted)
project
- projectname
- data type namerestricted
- allowed DSL elements. Collection should contain stereotypes and/or metaclass classes (java.lang.Class)@CheckForNull public static Classifier findClassifierOrDataType(Project project, java.lang.String name, @CheckForNull java.util.Collection restricted, @CheckForNull Namespace root)
project
- projectname
- classifier name simple or qualified)restricted
- allowed DSL elements. Collection should contain stereotypes and/or metaclass classes (java.lang.Class)root
- root element. Null means whole projectUML2Constants.CORE_CLASSIFIERS
@CheckForNull public static Classifier findClassifierOrDataType(Project project, java.lang.String name, @CheckForNull java.lang.Class[] types, @CheckForNull java.util.Collection restricted, @CheckForNull Namespace root)
project
- projectname
- classifier nametypes
- classifier typesrestricted
- Allowed DSL elements. Collection should contain stereotypes and/or metaclass classes (java.lang.Class)root
- root element. Null means whole projectUML2Constants.CORE_CLASSIFIERS
@CheckForNull public static Classifier findOrCreateClassifier(Project project, @CheckForNull Element context, java.lang.String name, ClassifierFinder.SimpleNameResolver simpleNameResolver)
@CheckForNull public static Classifier findOrCreateClassifier(Project project, @CheckForNull Element context, java.lang.String name, ClassifierFinder.SimpleNameResolver simpleNameResolver, boolean createIfNotFound)
@CheckForNull public static Classifier findOrCreateClassifier(Project project, @CheckForNull Element context, java.lang.String name, java.lang.Class createType)
@CheckForNull public static Classifier findOrCreateClassifier(Project project, @CheckForNull Element context, java.lang.String name, java.lang.Class createType, java.util.Collection<java.lang.Class> searchType, @CheckForNull ClassifierFinder.SimpleNameResolver simpleNameResolver)
@CheckForNull public static Classifier findOrCreateClassifier(@CheckForNull Project project, @CheckForNull Element context, java.lang.String name, java.lang.Class createType, java.util.Collection<java.lang.Class> searchType, @CheckForNull ClassifierFinder.SimpleNameResolver simpleNameResolver, boolean createIfNotFound)
@CheckForNull public static Classifier findOrCreateClassifier(@CheckForNull Project project, @CheckForNull Element context, java.lang.String name, java.lang.Class createType, java.util.Collection<java.lang.Class> searchType, @CheckForNull ClassifierFinder.SimpleNameResolver simpleNameResolver, boolean createIfNotFound, @CheckForNull PresentationElement contextView)
context
- element used to find nearest Package and use it as rootname
- name of classifier. If classifier contains "::" then assuming that name is qualifiedcreateType
- a classifier type to create if not found (for example Class.class or Interface.class)searchType
- a collection of classifier types to search for (for example Class.class or Interface.class)simpleNameResolver
- simple name resolvercontextView
- context viewcreateIfNotFound
- should new classifier be created if existing is not found@CheckForNull public static Classifier createClassifier(java.lang.String elementName, java.lang.Class type, @CheckForNull java.util.List suggestedByDSL, Namespace root)
@CheckForNull public static Classifier createClassifier(java.lang.String qualifiedName, java.lang.Class type, Namespace root)
qualifiedName
- qualifiedNametype
- classifier typeroot
- root namespace@CheckForNull public static Namespace findOrCreatePackageForElement(java.lang.String qualifiedElementName, @Nonnull Namespace root)
qualifiedElementName
- qualified name of element (not the package!) from a given root elementroot
- parent package where packages will be created@CheckForNull public static Namespace findOrCreateNamespaceForElement(java.lang.String qualifiedElementName, java.lang.Class searchType, @CheckForNull java.lang.Class createType, @Nonnull Namespace root)
qualifiedElementName
- qualified name of element inside a namespace (not namespace itself!!!)searchType
- class type of namespace to findcreateType
- class type of namespace to create. Null if do not want to create a namespaceroot
- rootpublic static boolean isQualifiedName(java.lang.String elementName)
elementName
- name