Package com.nomagic.profiles
Class ProfileImplementation
- java.lang.Object
-
- com.nomagic.profiles.ProfileImplementation
-
- Direct Known Subclasses:
MagicDrawProfile
,StandardProfile
,ValidationProfile
@OpenApi public abstract class ProfileImplementation extends java.lang.Object
Base class for a convenience class generated from a modeled Profile (UML), to allow quick access to profile's elements (Stereotypes, tag Properties, Enumerations, DataTypes)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
com.nomagic.profiles.ProfileImplementation.EnumerationWrapper
protected static class
com.nomagic.profiles.ProfileImplementation.ProfileElementWrapper<E extends Element>
protected static class
ProfileImplementation.StereotypeWrapper
Base class for generated stereotype wrapper for Stereotype from a modeled Profile (UML).protected static interface
com.nomagic.profiles.ProfileImplementation.TextProvider
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<com.nomagic.profiles.ProfileImplementation.ProfileElementWrapper>
allWrappers
private com.nomagic.profiles.ProfileCache
cache
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProfileImplementation(com.nomagic.profiles.ProfileCache cache)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
clearCache()
protected abstract java.util.Collection<com.nomagic.profiles.ProfileImplementation.ProfileElementWrapper>
generatedGetAllElementWrappers()
Generated method for getting all stereotype wrappers contained within this profile.protected abstract java.util.Collection<Stereotype>
generatedGetAllStereotypes()
Generated method for getting all stereotypes contained within this profile.java.util.Collection<Stereotype>
getAllStereotypes()
Gets all stereotypes contained within this profile.com.nomagic.profiles.ProfileCache
getCache()
DataType
getDataType(java.lang.String name)
It is recommended to avoid directly calling this method, and call method that matches the DataType name directly, as a separate method is generated for each DataType of the Profile.Profile
getProfile()
Stereotype
getStereotype(java.lang.String name)
It is recommended to avoid directly calling this method, and call method that matches the Stereotype name directly, as a separate method is generated for each Stereotype of the Profile.boolean
isTypeOf(Element element, Stereotype stereotype)
boolean
isTypeOf(Element element, java.lang.String stereotypeName)
protected static <E extends java.lang.Enum<E> & com.nomagic.profiles.ProfileImplementation.TextProvider>
EvalueFromString(java.lang.Class<E> enumClass, java.lang.Object value)
-
-
-
Method Detail
-
getStereotype
@CheckForNull public final Stereotype getStereotype(java.lang.String name)
It is recommended to avoid directly calling this method, and call method that matches the Stereotype name directly, as a separate method is generated for each Stereotype of the Profile.- Parameters:
name
- of the Stereotype- Returns:
- Stereotype from this profile by a given name
-
getDataType
@CheckForNull public final DataType getDataType(java.lang.String name)
It is recommended to avoid directly calling this method, and call method that matches the DataType name directly, as a separate method is generated for each DataType of the Profile.- Parameters:
name
- of the Stereotype- Returns:
- Stereotype from this profile by a given name
-
getProfile
@CheckForNull public final Profile getProfile()
- Returns:
- UML Profile element which is represented by this implementation. Will return null if the Profile is not used/loaded in the currently analyzed Model (Project or Resource)
-
getCache
public com.nomagic.profiles.ProfileCache getCache()
- Returns:
- returns profile cache.
-
isTypeOf
public boolean isTypeOf(Element element, @CheckForNull Stereotype stereotype)
- Returns:
- true if given Element has applied the given stereotype or a stereotype derived from it
-
isTypeOf
public boolean isTypeOf(Element element, java.lang.String stereotypeName)
- Returns:
- true if given Element has applied the given stereotype or a stereotype derived from it
-
getAllStereotypes
public java.util.Collection<Stereotype> getAllStereotypes()
Gets all stereotypes contained within this profile.- Returns:
- unmodifiable collection containing all stereotypes within this profile.
-
generatedGetAllStereotypes
protected abstract java.util.Collection<Stereotype> generatedGetAllStereotypes()
Generated method for getting all stereotypes contained within this profile.- Returns:
- gets all stereotypes contained within this profile.
-
generatedGetAllElementWrappers
protected abstract java.util.Collection<com.nomagic.profiles.ProfileImplementation.ProfileElementWrapper> generatedGetAllElementWrappers()
Generated method for getting all stereotype wrappers contained within this profile.- Returns:
- gets all stereotype wrappers contained within this profile.
-
clearCache
protected void clearCache()
-
valueFromString
@CheckForNull protected static <E extends java.lang.Enum<E> & com.nomagic.profiles.ProfileImplementation.TextProvider> E valueFromString(java.lang.Class<E> enumClass, @CheckForNull java.lang.Object value)
-
-