@OpenApiAll public class StereotypesHelper extends TagsHelper
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UML2METAMODEL
Name of UML2 metamodel
|
static java.lang.String |
UML2METAMODEL_PRIMITIVE_TYPES
Name of primitives package in the UML2 metamodel
|
static java.lang.String |
UML2METAMODEL_URI
URI of UML2 metamodel, must correspond UML standard profile metamodel uri.
|
Constructor and Description |
---|
StereotypesHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
addStereotype(Element element,
Stereotype stereotype)
Applies stereotype to a given element.
|
static void |
addStereotype(Element element,
Stereotype stereotype,
int index)
Applies stereotype to a given element.
|
static void |
addStereotypes(Element element,
java.util.Collection<Stereotype> stereotypes)
Applies stereotypes from collection for specified element.
|
static void |
applyProfile(Package pkg,
Profile profile)
Applies profile to the package
|
static void |
applyProfiles(Package pkg,
java.util.Collection<Profile> profiles)
Applies profiles from collection to specified package
|
static void |
assignImageFilesToStereotype(Stereotype stereotype,
java.util.Collection<java.io.File> files)
Assigns given image files to stereotype as icons.
|
static boolean |
canApplyProfile(Package pkg,
Profile profile)
Checks profile can apply to package.
|
static boolean |
canApplyStereotype(Element element,
Stereotype stereotype)
Checks if stereotype can be applied to element
|
static boolean |
canAssignStereotype(Element element,
Stereotype stereotype)
Indicates if stereotype can be applied to a given element.
|
static boolean |
canRemoveProfile(Package pkg,
Profile profile)
Checks if it is possible to remove applied profile from package
|
static Stereotype |
checkForDerivedStereotype(java.util.Collection<Stereotype> stereotypes,
Stereotype parent)
Checks if there are given stereotype or derived stereotype in a given stereotypes collection.
|
static Stereotype |
checkForDerivedStereotype(Element element,
java.util.Collection<Stereotype> stereotypes)
Checks if there are child of at least one given stereotype already set to given element
|
static Stereotype |
checkForDerivedStereotype(Element element,
Stereotype stereotype)
Checks if the given stereotype or it's child is already applied to the element.
|
static Stereotype |
createStereotype(Element owner,
java.lang.String name,
java.util.Collection<Class> metaClasses)
Creates stereotype instance and sets base classes for it
|
static Stereotype |
createStereotype(Project project,
java.lang.String name,
java.util.Collection<Class> metaClasses)
Creates stereotype instance and sets base classes for it
|
static void |
deriveStereotype(Stereotype parent,
Stereotype child)
Derives stereotype from other stereotype.
|
static java.util.Collection<? extends Element> |
filterVisibleElement(java.util.Collection<? extends Element> elements)
Filter elements from given collection whose are "visible".
|
static java.util.Collection<Stereotype> |
filterVisibleStereotypes(java.util.Collection<Stereotype> stereotypes)
Filter stereotypes from given collection whose are "visible".
|
static java.util.List<Stereotype> |
findCommonAssignedStereotypes(java.util.Collection<? extends Element> elements)
Finds common applied stereotypes for list of collection
|
static java.util.Collection<Stereotype> |
getAllAssignedStereotypes(java.util.Collection<? extends Element> elements)
Returns all applied stereotypes for elements of collection
|
static java.util.Collection<Class> |
getAllMetaClasses(Project project)
Returns collection of all meta model classes
|
static java.util.Collection<Model> |
getAllMetaModels(Project project)
Returns collection of all model elements
|
static java.util.Collection<Profile> |
getAllProfiles(Project project)
Returns list of all loaded profiles.
|
static java.util.Collection<Stereotype> |
getAllStereotypes(Project project)
Returns collection of all stereotypes
|
static java.util.Collection<Profile> |
getAppliedProfiles(Package pkg)
Returns collection of applied profiles on package
|
static Stereotype |
getAppliedStereotypeByString(Element element,
java.lang.String stereotype)
Returns stereotype applied to element.
|
static java.util.List<Class> |
getAssignedMetaClassOfSubtype(Stereotype stereotype,
Class meta)
Collect all subtypes of given meta classes whose are extended by a given stereotype
|
static Class |
getBaseClass(Element element)
Returns meta class of given element.
|
static java.util.List<Class> |
getBaseClasses(Stereotype stereotype)
Returns all base (meta) classes for stereotype
|
static java.util.List<Class> |
getBaseClasses(Stereotype stereotype,
boolean includeFromParentStereotypes)
Returns all base (meta) classes for stereotype
|
static java.util.Collection<java.lang.Class> |
getBaseClassesAsClasses(Stereotype stereotype)
Returns collection(java.lang.Class) of metaclasses from stereotype
|
static java.lang.Class |
getClassOfMetaClass(Class metaClass)
Returns java.lang.Class for meta class by Class
|
static java.util.Collection<Class> |
getDefaultMetaClasses(Project project)
Dummy procedure for setting of meta classes
|
static java.util.Collection<Profile> |
getDependingProfiles(Profile profile)
Returns collection of depending profile for profile
|
static java.util.Collection<Stereotype> |
getDerivedStereotypes(Element element,
Stereotype parent,
boolean includeParent)
Returns applied derived stereotypes
|
static java.util.List<Stereotype> |
getDerivedStereotypesRecursively(Stereotype stereotype)
Returns derived stereotypes recursively
|
static java.util.Collection<Element> |
getElementsRequiresExtension(Extension extension)
Checks which stereotyped elements requires this extension (it provides base class for stereotyped element).
|
static Extension |
getExtension(Stereotype stereotype,
Class baseClass)
Checks if stereotype has baseClass as METACLASS
|
static ExtensionEnd |
getExtensionEnd(Extension extension)
ExtensionEnd of given Extension
|
static java.util.Collection<Property> |
getExtensionMetaProperty(Stereotype stereotype)
Collects properties of MetaClass extension end
|
static java.util.Collection<Property> |
getExtensionMetaProperty(Stereotype stereotype,
boolean includeInherited)
Collects properties of MetaClass extension end
|
static java.util.Collection<Extension> |
getExtensions(Stereotype stereotype,
Class baseClass)
Collects Extensions connected to this stereotype.
|
static java.util.Collection<Extension> |
getExtensions(Stereotype stereotype,
Class baseClass,
boolean takeInherited)
Get Extension Meta Property.
|
static Stereotype |
getFirstStereotypeWithIcon(java.util.Collection<? extends Stereotype> collectionOfStereotypes)
Returns first stereotype with icon from given collection of stereotypes.
|
static Stereotype |
getFirstStereotypeWithIcon(java.util.Collection<? extends Stereotype> collectionOfStereotypes,
boolean includeInvisible)
Returns first stereotype with icon from given collection of stereotypes.
|
static Stereotype |
getFirstVisibleStereotype(java.util.Collection<? extends Stereotype> stereotypes)
Returns first visible stereotype from given collection of stereotypes.
|
static Stereotype |
getFirstVisibleStereotype(Element element)
Returns first visible stereotype applied to given element.
|
static ResizableIcon |
getIcon(Stereotype stereotype)
Returns ICON from stereotype
|
static Class |
getMetaClassByClass(Project project,
java.lang.Class clazz)
Returns meta class by given class.
|
static Class |
getMetaClassByName(Project project,
java.lang.String name)
Returns meta class by name
|
static Class |
getMetaClassByName(java.lang.String name,
java.util.Collection<Model> models)
Returns meta class by name from collection of models
|
static java.util.Collection<Class> |
getMetaClasses(java.util.Collection<? extends Model> models)
Returns meta classes by collection of models
|
static java.util.List<Class> |
getMetaClassesByClass(Project project,
java.util.Collection<java.lang.Class> classes)
Returns names of meta classes from collection
|
static Class |
getMetaClassesFromPackageByName(Package pkg,
java.lang.String name)
Search for class in given scope(package) by class name.
|
static Model |
getMetaModelByElement(Element element)
Returns meta model of specified element in the meta model.
|
static Model |
getMetaModelByMetaClass(Class c)
Returns meta model of specified meta class.
|
static Model |
getMetaModelByName(Project project,
java.lang.String name)
Return meta model with specified name.
|
static java.util.Collection<java.lang.String> |
getNamesOfMetaClasses(java.util.Collection<? extends Model> models)
Returns names of meta classes by collection of models
|
static java.util.Collection<java.lang.String> |
getNamesOfSuperClasses(Class aClass)
Returns names of supper classes for meta class
|
static PrimitiveType |
getPrimitiveByName(Project project,
java.lang.String name)
Finds primitiveType by name
|
static Package |
getPrimitiveTypesPackage(Project project)
Returns primitive types package of UML2 metamodel.
|
static Profile |
getProfile(Project project,
java.lang.String profileName)
Returns profile element by name
|
static Profile |
getProfileByURI(Project project,
java.lang.String profileURI)
Returns profile element by URI
|
static Package |
getProfileForStereotype(Stereotype stereotype)
Returns profile for a given stereotype.
|
static java.util.Collection<Profile> |
getProfiles(Project project,
java.lang.String profileName)
Filters all given project profiles by name.
|
static java.util.Collection<Stereotype> |
getSettableStereotypes(Project project,
java.util.Collection<? extends Element> elements,
boolean includeSuperTypes)
Returns collection of settable stereotypes for collection of elements
|
static java.util.Collection<Stereotype> |
getSettableStereotypes(Project project,
java.lang.String elementType,
boolean includeSuperTypes)
Returns collection of settable stereotypes for element type
|
static Stereotype |
getStereotype(Project project,
java.lang.String stereotypeName,
Profile profile)
Returns stereotype for given name by profile.
|
static java.util.List<Element> |
getStereotypedElements(Stereotype stereotype)
Returns all elements stereotyped by stereotype
|
static java.util.Collection<Element> |
getStereotypedElementsIncludingDerived(Stereotype stereotype)
Returns all elements stereotyped by stereotype and by stereotypes derived from this stereotype.
|
static java.util.List<Stereotype> |
getStereotypes(Element element)
Returns all stereotypes applied to element.
|
static java.util.Set<Stereotype> |
getStereotypesByMetaClasses(java.util.Collection<Class> metaClasses)
Collects stereotypes which extend given meta classes.
|
static java.util.Collection<Stereotype> |
getStereotypesByProfile(Profile profile)
Returns collection of stereotypes by profile
|
static Class |
getUML2BaseClass(Element element)
Returns UML2 metamodel metaclass for a given Element.
|
static Class |
getUML2MetaClassByName(Project project,
java.lang.String name)
/**
Returns meta class from UML2 meta model by name
|
static java.util.Collection<Class> |
getUML2MetaClasses(Project project)
Returns collection of all UML2 meta classes
|
static Model |
getUML2MetaModel(Project project)
Returns model element for UML2 meta model
|
static boolean |
hasStereotype(Element element)
Checks if element has applied stereotypes
|
static boolean |
hasStereotype(Element element,
java.util.Collection<Stereotype> stereotypes)
Checks if element has applied at least one stereotype from given collection of Stereotypes.
|
static boolean |
hasStereotype(Element element,
Stereotype stereotype)
Checks if element has applied stereotype.
|
static boolean |
hasStereotypedElements(Stereotype stereotype)
Checks if stereotype has stereotyped elements
|
static boolean |
hasStereotypeOrDerived(Element element,
java.util.Collection<Stereotype> stereotypes)
Checks if element has applied at least one stereotype(or derived) from given collection of Stereotypes.
|
static boolean |
hasStereotypeOrDerived(Element element,
Stereotype stereotype)
Checks if there are child of parent stereotype already set
|
static boolean |
hasSuperMetaClass(Stereotype stereotype,
Class meta)
Checks if stereotype has super meta class.
|
static boolean |
hasVisibleStereotype(Element element)
Check if given element has at least one visible stereotype.
|
static boolean |
isBuiltInUML2Metamodel(Model model)
Checks if given model is built in (not user modeled) UML metamodel.
|
static boolean |
isExtensionProperty(Property property) |
static boolean |
isFromPrimitiveTypes(Element element)
Checks if given element is from UML2 metamodel primitive types package
|
static boolean |
isInvisible(RedefinableElement element)
Check is element is invisible (has Invisible stereotype or one of it's children)
|
static boolean |
isMetaClass(Class aClass)
Checks if Class is meta class, including user defined meta classes.
|
static boolean |
isMetaClass(Element element)
Checks if given element is a meta class, including user defined meta classes.
|
static boolean |
isOfType(Element element,
java.util.Collection<java.lang.Class> metaTypes,
boolean checkDSL)
Checks if element is of type from given meta-types
|
static boolean |
isRequiredStereotypeForElement(Stereotype stereotype,
Element element)
Checks if stereotype is required for element
|
static boolean |
isTypeOf(Element element,
java.util.Collection<Classifier> typesCollection,
boolean includeInherited)
Checks if element is of type from typesCollection.
|
static boolean |
isTypeOf(Element element,
java.util.Collection<Classifier> typesCollection,
boolean includeInherited,
boolean includeCustomTypes)
Checks if element is of type from typesCollection.
|
static boolean |
isUML2MetaClass(Class aClass)
Checks if Class is meta class, and this meta class represents currently instantiated UML model.
|
static void |
optimizeStereotypes(Element element)
Optimize applied stereotypes to an Element by removing more general stereotypes if more specific are applied.
|
static void |
removeBaseClass(Stereotype stereotype,
Class metaClass)
removes base (meta) class for stereotype
|
static void |
removeProfile(Package pkg,
Profile profile)
Removes profile application from the package
|
static void |
removeProfiles(Package pkg,
java.util.Collection<Profile> profiles)
Removes applied profiles in package from collection
|
static void |
removeStereotype(Element element,
Stereotype stereotype)
Remove applied stereotype from element.
|
static void |
removeStereotypes(Element element)
Removes all applied stereotypes from element.
|
static void |
removeStereotypes(Element element,
java.util.Collection<Stereotype> stereotypes)
Removes all stereotypes from element.
|
static void |
removeSuperMetaClasses(Stereotype stereotype,
Class meta)
Remove super meta class from the given stereotype.
|
static Extension |
setBaseClass(Stereotype stereotype,
Class metaClass,
Extension extension)
Sets base (meta) class for stereotype
|
static void |
setBaseClasses(Stereotype stereotype,
java.util.Collection<Class> metaClasses)
Sets base (meta) classes for stereotype
|
static void |
setBaseClassesByName(Stereotype stereotype,
java.util.Collection<java.lang.String> metaClasses)
Sets base (meta) classes for stereotype by names
|
addTaggedValueValue, addTaggedValueValue, clearStereotypeProperty, clearStereotypeProperty, clearStereotypeProperty, clearStereotypeProperty, collectVisibleTaggedValues, createDefaultValues, createDefaultValues, getPropertiesWithDerived, getPropertiesWithDerivedOrdered, getPropertyByName, getStereotypePropertyFirst, getStereotypePropertyFirst, getStereotypePropertyFirst, getStereotypePropertyFirst, getStereotypePropertyStringValue, getStereotypePropertyValue, getStereotypePropertyValue, getStereotypePropertyValue, getStereotypePropertyValue, getStereotypePropertyValueAsString, getStereotypePropertyValueAsString, getTagDefinitionOwner, getTaggedValue, getTaggedValue, getTaggedValue, getTaggedValueOrCreate, getTaggedValueOrCreate, hasStereotypePropertyValues, isValidTagType, removeTaggedValueValue, removeTaggedValueValue, setStereotypePropertyValue, setStereotypePropertyValue, setStereotypePropertyValue, setStereotypePropertyValue, setStereotypePropertyValue, setStereotypePropertyValue
addStereotypeByString, addStereotypeByString, addStereotypesWithNames, getExtendedElements, getExtendedElementsIncludingDerived, getStereotype, getStereotype, getStereotypePropertyValue, getStereotypePropertyValue, hasExtendedElements, hasStereotype, hasStereotype, hasStereotypeOrDerived, removeStereotypeByString
clearStereotypeProperty, clearStereotypeProperty, getStereotypePropertyFirst, getStereotypePropertyFirst, getStereotypePropertyValue, getStereotypePropertyValue, getStereotypePropertyValueAsString, getStereotypePropertyValueAsString
public static final java.lang.String UML2METAMODEL
public static final java.lang.String UML2METAMODEL_URI
public static final java.lang.String UML2METAMODEL_PRIMITIVE_TYPES
public static java.util.Collection<Profile> getAllProfiles(Project project)
project
- project@CheckForNull public static Profile getProfile(Project project, java.lang.String profileName)
project
- projectprofileName
- profile name@CheckForNull public static Profile getProfileByURI(Project project, java.lang.String profileURI)
project
- projectprofileURI
- profile uripublic static java.util.Collection<Profile> getProfiles(Project project, java.lang.String profileName)
project
- given projectprofileName
- the profile namepublic static java.util.List<Stereotype> getStereotypes(Element element) throws java.lang.IllegalArgumentException
element
- elementjava.lang.IllegalArgumentException
- if element is nullpublic static boolean hasStereotype(Element element) throws java.lang.IllegalArgumentException
element
- elementjava.lang.IllegalArgumentException
- if element is nullpublic static boolean hasStereotype(Element element, @CheckForNull Stereotype stereotype) throws java.lang.IllegalArgumentException
element
- elementstereotype
- stereotype name to checkjava.lang.IllegalArgumentException
- if element is nullpublic static boolean hasStereotype(Element element, java.util.Collection<Stereotype> stereotypes) throws java.lang.IllegalArgumentException
element
- elementstereotypes
- a collection of stereotypesjava.lang.IllegalArgumentException
- if element is nullpublic static void addStereotype(Element element, Stereotype stereotype) throws java.lang.IllegalArgumentException
TagsHelper.createDefaultValues(Element, Stereotype, boolean)
.element
- elementstereotype
- stereotype to applyjava.lang.IllegalArgumentException
- if element or stereotype is null, or element is disposedpublic static void addStereotype(Element element, Stereotype stereotype, int index) throws java.lang.IllegalArgumentException
TagsHelper.createDefaultValues(Element, Stereotype, boolean)
.element
- elementstereotype
- stereotype to applyindex
- index of the stereotypejava.lang.IllegalArgumentException
- if element or stereotype is nullpublic static void addStereotypes(Element element, java.util.Collection<Stereotype> stereotypes) throws java.lang.IllegalArgumentException
TagsHelper.createDefaultValues(Element, Stereotype, boolean)
.element
- element on which stereotypes are appliedstereotypes
- collection of Stereotype
objectsjava.lang.IllegalArgumentException
- if element or stereotypes is nullpublic static void removeStereotype(@CheckForNull Element element, @CheckForNull Stereotype stereotype) throws java.lang.IllegalArgumentException
element
- elementstereotype
- stereotype to removejava.lang.IllegalArgumentException
- if element or stereotype is nullpublic static void removeStereotypes(Element element) throws java.lang.IllegalArgumentException
element
- elementjava.lang.IllegalArgumentException
- if element is nullpublic static void removeStereotypes(Element element, java.util.Collection<Stereotype> stereotypes) throws java.lang.IllegalArgumentException
element
- elementstereotypes
- collection of stereotypes to removejava.lang.IllegalArgumentException
- if element or stereotypes is null@CheckForNull public static Stereotype getAppliedStereotypeByString(Element element, java.lang.String stereotype)
element
- elementstereotype
- name of stereotype@CheckForNull public static Stereotype getStereotype(Project project, java.lang.String stereotypeName, @CheckForNull Profile profile)
project
- projectstereotypeName
- name of stereotypeprofile
- stereotype's profile, null if anypublic static java.util.Collection<Element> getStereotypedElementsIncludingDerived(@CheckForNull Stereotype stereotype)
stereotype
- stereotypepublic static java.util.List<Element> getStereotypedElements(@CheckForNull Stereotype stereotype)
stereotype
- stereotypepublic static boolean hasStereotypedElements(Stereotype stereotype)
stereotype
- stereotype to check@CheckForNull public static Stereotype getFirstStereotypeWithIcon(java.util.Collection<? extends Stereotype> collectionOfStereotypes)
collectionOfStereotypes
- a collection of stereotypes.@CheckForNull public static Stereotype getFirstStereotypeWithIcon(java.util.Collection<? extends Stereotype> collectionOfStereotypes, boolean includeInvisible)
collectionOfStereotypes
- a collection of stereotypes.includeInvisible
- indicates whether invisible stereotypes should be taken into account.@CheckForNull public static Stereotype getFirstVisibleStereotype(Element element)
element
- given element.@CheckForNull public static Stereotype getFirstVisibleStereotype(java.util.Collection<? extends Stereotype> stereotypes)
stereotypes
- a collection of stereotypes.public static java.util.Collection<Stereotype> getAllStereotypes(Project project)
project
- projectpublic static java.util.List<Stereotype> findCommonAssignedStereotypes(java.util.Collection<? extends Element> elements)
elements
- collection of elementspublic static java.util.Collection<Stereotype> getAllAssignedStereotypes(java.util.Collection<? extends Element> elements)
elements
- collection of elements@CheckForNull public static Extension getExtension(Stereotype stereotype, Class baseClass)
stereotype
- stereotypebaseClass
- meta classpublic static java.util.Collection<Extension> getExtensions(Stereotype stereotype, Class baseClass)
stereotype
- StereotypebaseClass
- Base class.public static java.util.Collection<Extension> getExtensions(Stereotype stereotype, Class baseClass, boolean takeInherited)
stereotype
- StereotypebaseClass
- Base class.takeInherited
- collect inherited extension ends alsopublic static java.util.List<Class> getBaseClasses(@CheckForNull Stereotype stereotype)
stereotype
- stereotypepublic static java.util.List<Class> getBaseClasses(@CheckForNull Stereotype stereotype, boolean includeFromParentStereotypes)
stereotype
- stereotypeincludeFromParentStereotypes
- also take bases classes from parent stereotypespublic static java.util.Collection<Stereotype> getSettableStereotypes(Project project, java.lang.String elementType, boolean includeSuperTypes)
project
- projectelementType
- element typeincludeSuperTypes
- include super types alsopublic static java.util.Collection<Stereotype> getSettableStereotypes(Project project, java.util.Collection<? extends Element> elements, boolean includeSuperTypes)
project
- projectelements
- collection of elementsincludeSuperTypes
- include super types also@CheckForNull public static Model getUML2MetaModel(Project project)
project
- projectpublic static boolean isBuiltInUML2Metamodel(Model model)
model
- model to checkpublic static java.util.Collection<Model> getAllMetaModels(Project project)
project
- project@CheckForNull public static Model getMetaModelByName(Project project, java.lang.String name)
project
- project to search for meta model.name
- name meta model name.null
if not found.public static java.util.Collection<Class> getAllMetaClasses(Project project)
project
- projectpublic static java.util.Collection<Class> getUML2MetaClasses(Project project)
project
- projectpublic static java.util.Collection<Class> getMetaClasses(java.util.Collection<? extends Model> models)
models
- collection of modelspublic static java.util.Collection<java.lang.String> getNamesOfMetaClasses(java.util.Collection<? extends Model> models)
models
- collection of models@CheckForNull public static Class getMetaClassByName(Project project, java.lang.String name)
project
- projectname
- name of meta class@CheckForNull public static Class getMetaClassByName(java.lang.String name, java.util.Collection<Model> models)
name
- name of meta classmodels
- collection of models to look for@CheckForNull public static Class getMetaClassesFromPackageByName(Package pkg, java.lang.String name)
pkg
- Package instance.name
- Class name@CheckForNull public static Class getUML2MetaClassByName(Project project, java.lang.String name)
project
- given projectname
- name of meta class@CheckForNull public static Model getMetaModelByMetaClass(Class c)
c
- meta classnull
if c
is not meta class@CheckForNull public static Model getMetaModelByElement(Element element)
element
- meta class or other meta element.null
if element
is not meta classpublic static boolean isMetaClass(Element element)
isUML2MetaClass(Class)
element
- classpublic static boolean isMetaClass(Class aClass)
isUML2MetaClass(Class)
aClass
- classpublic static boolean isUML2MetaClass(Class aClass)
aClass
- classpublic static void setBaseClassesByName(Stereotype stereotype, java.util.Collection<java.lang.String> metaClasses)
stereotype
- stereotypemetaClasses
- collection of meta classes namespublic static void setBaseClasses(Stereotype stereotype, java.util.Collection<Class> metaClasses)
stereotype
- stereotypemetaClasses
- collection of meta classes@CheckForNull public static Extension setBaseClass(Stereotype stereotype, @CheckForNull Class metaClass, @CheckForNull Extension extension)
stereotype
- stereotypemetaClass
- meta classextension
- extension for class and stereotypepublic static void removeBaseClass(Stereotype stereotype, @CheckForNull Class metaClass)
stereotype
- stereotypemetaClass
- meta class@CheckForNull public static Stereotype createStereotype(Element owner, java.lang.String name, java.util.Collection<Class> metaClasses)
owner
- owner of stereotypename
- name of stereotypemetaClasses
- meta classes for stereotype@CheckForNull public static Stereotype createStereotype(Project project, java.lang.String name, java.util.Collection<Class> metaClasses)
project
- projectname
- name of stereotypemetaClasses
- meta classes for stereotypepublic static java.util.Collection<Class> getDefaultMetaClasses(Project project)
project
- projectpublic static java.util.Collection<java.lang.String> getNamesOfSuperClasses(Class aClass)
aClass
- meta class UML classpublic static boolean canApplyStereotype(@CheckForNull Element element, @CheckForNull Stereotype stereotype)
element
- elementstereotype
- stereotype@CheckForNull public static ResizableIcon getIcon(@CheckForNull Stereotype stereotype)
stereotype
- stereotypepublic static void deriveStereotype(Stereotype parent, Stereotype child)
parent
- parent stereotypechild
- child stereotype@CheckForNull public static Class getMetaClassByClass(Project project, java.lang.Class clazz)
project
- projectclazz
- class from which to get name frompublic static java.util.List<Class> getMetaClassesByClass(Project project, java.util.Collection<java.lang.Class> classes)
project
- projectclasses
- collection of meta classes to get names from@CheckForNull public static Class getBaseClass(Element element)
element
- given element@CheckForNull public static Class getUML2BaseClass(Element element)
element
- given elementpublic static java.util.Collection<java.lang.Class> getBaseClassesAsClasses(@CheckForNull Stereotype stereotype)
stereotype
- stereotypepublic static boolean canAssignStereotype(Element element, Stereotype stereotype)
- checks if stereotype meta class fits class of an element.
element
- element to which stereotype should be applied.stereotype
- stereotype to assign.public static boolean isInvisible(@CheckForNull RedefinableElement element)
element
- elementMagicDrawProfile.InvisibleStereotypeStereotype#getStereotype()
public static boolean canApplyProfile(Package pkg, Profile profile)
pkg
- The given package.profile
- The given profile.public static void applyProfile(Package pkg, Profile profile)
pkg
- packageprofile
- profile to applypublic static void removeProfile(Package pkg, Profile profile)
pkg
- packageprofile
- applied profilepublic static java.util.Collection<Stereotype> getStereotypesByProfile(Profile profile)
profile
- profilepublic static boolean isRequiredStereotypeForElement(Stereotype stereotype, Element element)
stereotype
- stereotypeelement
- elementpublic static java.lang.Class getClassOfMetaClass(Class metaClass)
metaClass
- meta classpublic static void applyProfiles(Package pkg, java.util.Collection<Profile> profiles)
pkg
- packageprofiles
- list of profilespublic static void removeProfiles(@CheckForNull Package pkg, @CheckForNull java.util.Collection<Profile> profiles)
pkg
- packageprofiles
- collection of profilespublic static java.util.Collection<Profile> getAppliedProfiles(@CheckForNull Package pkg)
pkg
- packagepublic static boolean canRemoveProfile(Package pkg, Profile profile)
pkg
- packageprofile
- profilepublic static java.util.Collection<Profile> getDependingProfiles(Profile profile)
profile
- profile@CheckForNull public static Stereotype checkForDerivedStereotype(Element element, Stereotype stereotype)
element
- elementstereotype
- stereotype@CheckForNull public static Stereotype checkForDerivedStereotype(Element element, java.util.Collection<Stereotype> stereotypes)
element
- elementstereotypes
- a collection of stereotypes to check@CheckForNull public static Stereotype checkForDerivedStereotype(java.util.Collection<Stereotype> stereotypes, Stereotype parent)
stereotypes
- collection of stereotypes to look inparent
- parent stereotypepublic static java.util.Collection<Stereotype> getDerivedStereotypes(Element element, Stereotype parent, boolean includeParent)
element
- elementparent
- stereotypeincludeParent
- true if include parent stereotype in collectionpublic static boolean hasStereotypeOrDerived(Element element, @CheckForNull Stereotype stereotype)
element
- elementstereotype
- stereotypepublic static boolean hasStereotypeOrDerived(Element element, java.util.Collection<Stereotype> stereotypes) throws java.lang.IllegalArgumentException
element
- element to checkstereotypes
- a collection of stereotypesjava.lang.IllegalArgumentException
- if element is nullpublic static java.util.Set<Stereotype> getStereotypesByMetaClasses(java.util.Collection<Class> metaClasses)
metaClasses
- meta classes@CheckForNull public static ExtensionEnd getExtensionEnd(Extension extension)
extension
- Extensionpublic static void assignImageFilesToStereotype(Stereotype stereotype, java.util.Collection<java.io.File> files)
stereotype
- stereotype to which icons should be appliedfiles
- image files to assignpublic static java.util.List<Stereotype> getDerivedStereotypesRecursively(Stereotype stereotype)
stereotype
- stereotype for which to return derived stereotypespublic static java.util.Collection<Element> getElementsRequiresExtension(Extension extension)
extension
- extension to check.public static java.util.List<Class> getAssignedMetaClassOfSubtype(Stereotype stereotype, Class meta)
stereotype
- stereotypemeta
- meta classpublic static boolean hasSuperMetaClass(Stereotype stereotype, Class meta)
stereotype
- stereotypemeta
- meta classpublic static void removeSuperMetaClasses(Stereotype stereotype, Class meta)
stereotype
- stereotypemeta
- meta classpublic static boolean isExtensionProperty(Property property)
property
- property@CheckForNull public static Package getProfileForStereotype(Stereotype stereotype)
stereotype
- stereotypepublic static java.util.Collection<Property> getExtensionMetaProperty(Stereotype stereotype)
stereotype
- stereotype to check for meta classespublic static java.util.Collection<Property> getExtensionMetaProperty(Stereotype stereotype, boolean includeInherited)
stereotype
- stereotype to check for meta classesincludeInherited
- collection inherited meta propertiespublic static boolean isFromPrimitiveTypes(Element element)
element
- the given element@CheckForNull public static Package getPrimitiveTypesPackage(Project project)
project
- project.@CheckForNull public static PrimitiveType getPrimitiveByName(Project project, java.lang.String name)
project
- project where find primitive.name
- primitive name.public static boolean hasVisibleStereotype(Element element)
element
- given elementMagicDrawProfile.InvisibleStereotypeStereotype#getStereotype()
@CheckForNull public static java.util.Collection<Stereotype> filterVisibleStereotypes(@CheckForNull java.util.Collection<Stereotype> stereotypes)
stereotypes
- collection of stereotypesMagicDrawProfile.InvisibleStereotypeStereotype#getStereotype()
@CheckForNull public static java.util.Collection<? extends Element> filterVisibleElement(@CheckForNull java.util.Collection<? extends Element> elements)
elements
- collection of elementsMagicDrawProfile.InvisibleStereotypeStereotype#getStereotype()
public static void optimizeStereotypes(Element element)
element
- elementpublic static boolean isTypeOf(Element element, java.util.Collection<Classifier> typesCollection, boolean includeInherited)
element
- instance that type will be checked.typesCollection
- collection of types used to check if element type is part of itincludeInherited
- if set to true all element type hierarchy will be checked against typesCollectionpublic static boolean isTypeOf(Element element, java.util.Collection<Classifier> typesCollection, boolean includeInherited, boolean includeCustomTypes)
element
- instance that type will be checkedtypesCollection
- collection of types used to check if element type is part of itincludeInherited
- if set to true all element type hierarchy will be checked against typesCollectionincludeCustomTypes
- check against custom typespublic static boolean isOfType(Element element, java.util.Collection<java.lang.Class> metaTypes, boolean checkDSL)
element
- instance that type will be checkedmetaTypes
- meta typescheckDSL
- take DSL rules into account