Package com.nomagic.magicdraw.uml
Class ClassTypes
java.lang.Object
com.nomagic.magicdraw.uml.ClassTypes
Utility class for retrieving information about Elements class types - like super class types, subtypes and etc
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Class>
expandToConcreteMetaClasses
(Collection<Class> metaClasses) Method replaces each abstract meta class with direct subclasses.static Collection<String>
static List<Class<? extends Classifier>>
Returns a list of all classifiers types.static Class
getClassType
(String shortName) static Class
getClassType
(org.omg.mof.model.Classifier metatype) getClassTypesForElements
(Collection<? extends BaseElement> elements) getClassTypesForStereotypeBaseClasses
(Stereotype stereotype) getClassTypesForStereotypeBaseClasses
(Collection<Stereotype> stereotypes) getDirectSubtypes
(Class type, boolean includeAbstract) Gets only direct sub-types of the type.Returns a list of all namespaces types.static Collection<Class>
Returns a list of all classifiers types.static Collection<Class>
static String
getShortName
(Class type) getShortNameForClassTypes
(Collection<Class> types) getSubtypes
(Class type) getSubtypes
(Class type, boolean includeAbstract) getSubtypes
(Collection<Class> types) static Class[]
getSubtypesArray
(Class type) static Class[]
getSubtypesArray
(Class type, boolean includeAbstract) static Class[]
getSubtypesArray
(Collection<Class> type) static Class[]
getSubtypesArray
(Collection<Class> type, boolean includeAbstract) getSupertypes
(Class type) getTypeElements
(List<Object> types, Project project) Given a collection of types, returns a list of metamodel elements representing these types.static boolean
isRelationship
(Class type) Check if given class is relationshipstatic void
removeAbstract
(Collection<Class> classTypes)
-
Field Details
-
RELATIONSHIP_TYPES
Relationship like classes
-
-
Constructor Details
-
ClassTypes
public ClassTypes()
-
-
Method Details
-
getNameSpaces
Returns a list of all namespaces types.- Returns:
- a list of all namespaces types.
-
getClassifiers
Returns a list of all classifiers types.- Returns:
- a list of all classifiers types.
-
getPackagesNotProfile
Returns a list of all classifiers types.- Returns:
- a list of all classifiers types.
-
getSubtypes
- Parameters:
types
- base types- Returns:
- returns base types and subtypes of given types
-
getSubtypes
- Parameters:
type
- base type- Returns:
- returns base type and subtypes of given types
-
getSubtypes
- Parameters:
type
- base typeincludeAbstract
- include abstract classes- Returns:
- return base types and subtypes of given types
-
getSubtypesArray
- Parameters:
type
- base type- Returns:
- return subtypes as array, not as collection
-
getSubtypesArray
- Parameters:
type
- base typeincludeAbstract
- include abstract classes- Returns:
- return subtypes as array, not as collection
-
getSubtypesArray
- Parameters:
type
- base type- Returns:
- return subtypes as array, not as collection
-
getSubtypesArray
- Parameters:
type
- base typeincludeAbstract
- include abstract classes- Returns:
- return subtypes as array, not as collection
-
getDirectSubtypes
Gets only direct sub-types of the type. UsegetSubtypes(Class, boolean)
get get all available sub-types.- Parameters:
type
- the super typeincludeAbstract
- true if abstract should be return- Returns:
- collection of direct sub-types
-
getSupertypes
-
getClassType
-
getClassType
- Parameters:
shortName
- class short name- Returns:
- return a java class for given UML metaclass by name
-
getShortName
- Parameters:
type
- java class- Returns:
- UML metaclass name
-
getClassTypesForElements
-
getShortNameForClassTypes
-
getClassTypeForShortNames
-
removeAbstract
-
getClassTypesForStereotypeBaseClasses
-
getClassTypesForStereotypeBaseClasses
-
expandToConcreteMetaClasses
Method replaces each abstract meta class with direct subclasses. If subclass is abstract meta class as well then it gets replaced as well, till non abstract sub class is reached.- Parameters:
metaClasses
- meta classes collection.- Returns:
- set of unique non-abstract meta classes
-
getTypeElements
Given a collection of types, returns a list of metamodel elements representing these types.- Parameters:
types
- types for which to get the elements.project
- project in which to search.- Returns:
- a list of elements representing the types.
-
getRelationshipTypes
- Returns:
- relationships types
-
isRelationship
Check if given class is relationship- Parameters:
type
- given class- Returns:
- true if relationship
-
getAllClassNames
- Returns:
- all UML meta model class names
-