public class UML14MetafacadeUtils extends Object
Constructor and Description |
---|
UML14MetafacadeUtils() |
Modifier and Type | Method and Description |
---|---|
(package private) static boolean |
attributeExists(Object classifier,
String name)
Indicates whether or not the attribute exists on the given classifier.
|
(package private) static org.omg.uml.foundation.core.Attribute |
createAttribute(String name,
String fullyQualifiedTypeName,
String visibility,
String separator)
Creates an attribute having the give
name and the type
having the given fullyQualifiedTypeName , with the
specified visibility, if no type can be found with the given name, no
type is set. |
(package private) static Object |
findByFullyQualifiedName(String fullyQualifiedName,
String separator,
boolean modelName)
Finds a given model element in the model having the specified
fullyQualifiedName . |
(package private) static Object |
findByName(String name)
Finds and returns the first model element having the given
name in the modelPackage ,
returns null if not found. |
(package private) static org.omg.uml.foundation.core.UmlClass |
findClassWithTaggedValueOrHyperlink(String tag,
String value)
Returns the first class this method can find with the given tagged value or hyperlink.
|
(package private) static Collection<org.omg.uml.behavioralelements.statemachines.FinalState> |
findFinalStatesWithNameOrHyperlink(org.omg.uml.behavioralelements.usecases.UseCase useCase) |
(package private) static org.omg.uml.behavioralelements.activitygraphs.ActivityGraph |
findFirstActivityGraphWithName(String name)
Returns the first activity graph it can find with the given name.
|
(package private) static org.omg.uml.behavioralelements.activitygraphs.ActivityGraph |
findFirstActivityGraphWithNameAndStereotype(String name,
String stereotypeName)
Returns the first activity graph it can find with the given name and stereotype, if the stereotype is not
specified (it is null) it will be ignored and the returned activity graph may have any arbitrary stereotype.
|
(package private) static org.omg.uml.behavioralelements.usecases.UseCase |
findFirstUseCaseWithName(String name)
Returns the first use-case it can find with the given name.
|
(package private) static org.omg.uml.behavioralelements.usecases.UseCase |
findFirstUseCaseWithNameAndStereotype(String name,
String stereotypeName)
Returns the first use-case it can find with the given name and stereotype, if the stereotype is not specified (it
is null) it will be ignored and the returned use-case may have any arbitrary stereotype.
|
(package private) static org.omg.uml.foundation.core.Stereotype |
findOrCreateStereotype(String name)
Finds or creates a stereotype with the given name.
|
(package private) static org.omg.uml.behavioralelements.usecases.UseCase |
findUseCaseWithTaggedValueOrHyperlink(String tag,
String value)
Returns the first use-case this method can find with the given tagged value or hyperlink.
|
(package private) static org.omg.uml.foundation.core.CorePackage |
getCorePackage()
Basically just checks to make sure the
model is of type org.omg.uml.UmlPackage and
retrieves the CorePackage from it. |
(package private) static org.omg.uml.behavioralelements.activitygraphs.ActivityGraph |
getMetaClass(ActivityGraphFacade facade)
Finds the given metafacade class for the passed in
facade . |
(package private) static org.omg.uml.behavioralelements.statemachines.Event |
getMetaClass(EventFacade facade)
Finds the given metafacade class for the passed in
facade . |
(package private) static org.omg.uml.foundation.core.ModelElement |
getMetaClass(ModelElementFacade facade)
Finds the given metafacade class for the passed in
facade . |
(package private) static org.omg.uml.foundation.core.Parameter |
getMetaClass(ParameterFacade facade)
Finds the given metafacade class for the passed in
facade . |
(package private) static org.omg.uml.behavioralelements.usecases.UseCase |
getMetaClass(UseCaseFacade facade)
Finds the given metafacade class for the passed in
facade . |
(package private) static org.omg.uml.UmlPackage |
getModel()
Returns the entire model.
|
(package private) static String |
getPackageName(org.omg.uml.foundation.core.ModelElement metaObject,
String separator,
boolean modelName)
Constructs the package name for the given
metaObject , separating the package name by the given
separator . |
(package private) static org.omg.uml.modelmanagement.UmlPackage |
getRootPackage()
Gets the root package in the model.
|
static String |
getSerialVersionUID(ClassifierFacade classifier)
Retrieves the serial version UID by reading the tagged value
UMLProfile.TAGGEDVALUE_SERIALVERSION_UID of the
classifier . |
(package private) static org.omg.uml.foundation.datatypes.VisibilityKind |
getVisibilityKind(String visibility)
Gets the correct meta model visibility kind for the given
visibility string. |
(package private) static boolean |
isHyperlinkPresent(org.omg.uml.foundation.core.ModelElement element,
Object value)
Returns true if the given model element has a hyperlink with the given value, returns false otherwise.
|
(package private) static boolean |
isStereotypePresent(org.omg.uml.foundation.core.ModelElement element,
String stereotypeName) |
(package private) static boolean |
isTagPresent(org.omg.uml.foundation.core.ModelElement element,
String tag,
Object value)
Returns true if the given model element has a tag with the given name and value, returns false otherwise.
|
static List<ModelElementFacade> |
removeDuplicatesAndCopyTaggedValues(Collection<ModelElementFacade> elements)
This method removes all duplicates within the
elements collection while at the same
time copying tagged values from duplicates to the one remaining element with the given name. |
public UML14MetafacadeUtils()
static Object findByFullyQualifiedName(String fullyQualifiedName, String separator, boolean modelName)
fullyQualifiedName
. If the model element can NOT
be found, null
will be returned instead.fullyQualifiedName
- the fully qualified name of the element to
search for.separator
- the PSM separator used for qualifying the name (example
".").modelName
- a flag indicating whether or not a search shall be performed using
the fully qualified model name or fully qualified PSM name.static String getPackageName(org.omg.uml.foundation.core.ModelElement metaObject, String separator, boolean modelName)
metaObject
, separating the package name by the given
separator
.metaObject
- the Model Elementseparator
- the PSM namespace separatormodelName
- true/false on whether or not to get the model package name instead
of the PSM package name.static org.omg.uml.foundation.core.CorePackage getCorePackage()
model
is of type org.omg.uml.UmlPackage
and
retrieves the CorePackage
from it.model
as a org.omg.uml.UmlPackage
static Object findByName(String name)
name
in the modelPackage
,
returns null
if not found.name
- the name to find.static org.omg.uml.modelmanagement.UmlPackage getRootPackage()
static org.omg.uml.UmlPackage getModel()
static org.omg.uml.foundation.datatypes.VisibilityKind getVisibilityKind(String visibility)
visibility
string.visibility
- the visibility to retrieve.static org.omg.uml.foundation.core.Attribute createAttribute(String name, String fullyQualifiedTypeName, String visibility, String separator)
name
and the type
having the given fullyQualifiedTypeName
, with the
specified visibility, if no type can be found with the given name, no
type is set.name
- the new namefullyQualifiedTypeName
- the name of the fully qualified typevisibility
- the visibility nameseparator
- the separator used for qualifying the name.static boolean attributeExists(Object classifier, String name)
classifier
- the classifier to checkname
- the name of the attributestatic org.omg.uml.foundation.core.Stereotype findOrCreateStereotype(String name)
name
- the name of the stereotype.static org.omg.uml.behavioralelements.usecases.UseCase findFirstUseCaseWithName(String name)
name
- static org.omg.uml.behavioralelements.usecases.UseCase findFirstUseCaseWithNameAndStereotype(String name, String stereotypeName)
name
- stereotypeName
- static org.omg.uml.behavioralelements.activitygraphs.ActivityGraph findFirstActivityGraphWithName(String name)
name
- static org.omg.uml.behavioralelements.activitygraphs.ActivityGraph findFirstActivityGraphWithNameAndStereotype(String name, String stereotypeName)
name
- stereotypeName
- static boolean isTagPresent(org.omg.uml.foundation.core.ModelElement element, String tag, Object value)
element
- tag
- value
- static boolean isHyperlinkPresent(org.omg.uml.foundation.core.ModelElement element, Object value)
element
- value
- static boolean isStereotypePresent(org.omg.uml.foundation.core.ModelElement element, String stereotypeName)
element
- stereotypeName
- static org.omg.uml.behavioralelements.usecases.UseCase findUseCaseWithTaggedValueOrHyperlink(String tag, String value)
value
is used to search for the hyperlink.tag
- value
- static org.omg.uml.foundation.core.UmlClass findClassWithTaggedValueOrHyperlink(String tag, String value)
value
is used to search for the hyperlink.tag
- value
- static Collection<org.omg.uml.behavioralelements.statemachines.FinalState> findFinalStatesWithNameOrHyperlink(org.omg.uml.behavioralelements.usecases.UseCase useCase)
useCase
- static org.omg.uml.behavioralelements.activitygraphs.ActivityGraph getMetaClass(ActivityGraphFacade facade)
facade
.facade
- the model element facade for which to find the meta class.static org.omg.uml.behavioralelements.usecases.UseCase getMetaClass(UseCaseFacade facade)
facade
.facade
- the model element facade for which to find the meta class.static org.omg.uml.foundation.core.Parameter getMetaClass(ParameterFacade facade)
facade
.facade
- the model element facade for which to find the meta class.static org.omg.uml.behavioralelements.statemachines.Event getMetaClass(EventFacade facade)
facade
.facade
- the model element facade for which to find the meta class.static org.omg.uml.foundation.core.ModelElement getMetaClass(ModelElementFacade facade)
facade
.facade
- the model element facade for which to find the meta class.public static String getSerialVersionUID(ClassifierFacade classifier)
UMLProfile.TAGGEDVALUE_SERIALVERSION_UID
of the
classifier
.classifier
- the classifier to be inspected.null
if the tagged value cannot be found.public static List<ModelElementFacade> removeDuplicatesAndCopyTaggedValues(Collection<ModelElementFacade> elements)
elements
collection while at the same
time copying tagged values from duplicates to the one remaining element with the given name.elements
- the elements to remove duplicates and copy tagged values to.Copyright © 2003–2014 AndroMDA.org. All rights reserved.