public class UniqueStereotypeResolver
extends java.lang.Object
implements com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
Default stereotype resolution strategy: if the requested stereotype name matches exactly one Stereotype
in
all registered profiles, that stereotype is returned. Otherwise null
is returned.
Since this is the default strategy, its priority is 0.
Constructor and Description |
---|
UniqueStereotypeResolver() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription() |
java.lang.String |
getLabel() |
Stereotype |
getMatchingStereotype(java.util.List<Profile> registeredProfiles,
java.lang.String stereotypeName,
EAResource resource,
Element stereotypedElement)
The actual resolution strategy.
|
int |
getPriority() |
java.util.Map<java.lang.String,java.lang.String> |
getStereotypePropertyMap(java.lang.String stereotypeFqn)
Return a mapping of stereotype properties in case their EA and Eclipse UML names do not match.
|
boolean |
isDefaultEnabled() |
void |
stereotypeApplied(Element element,
Stereotype stereotype,
java.util.List<java.lang.String> eaStereotypes)
A notification that a matching stereotype was applied to the given element during loading.
|
public java.lang.String getLabel()
getLabel
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
null
, otherwise it will not be used!public java.lang.String getDescription()
getDescription
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
public int getPriority()
getPriority
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
null
, then the extension with the next highest priority is asked,
etc.public boolean isDefaultEnabled()
isDefaultEnabled
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
public Stereotype getMatchingStereotype(java.util.List<Profile> registeredProfiles, java.lang.String stereotypeName, EAResource resource, Element stereotypedElement)
com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
getMatchingStereotype
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
registeredProfiles
- This is a list of all registered profiles where the resolution strategy must pick the
Stereotype
of interest.stereotypeName
- The stereotype name as found in EA database; might be fully qualified or simple format.resource
- The EA Resource that is currently loaded; this resolver must not modify the resource or iterate
over its contents!stereotypedElement
- The UML element to which this stereotype will be applied; may be null
when all potential
stereotypes below a package are collected. This resolver must not modify the element or access any
of its children!Stereotype
or null
, if it cannot be found amongst the registered
profiles.public void stereotypeApplied(Element element, Stereotype stereotype, java.util.List<java.lang.String> eaStereotypes)
com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
If the implementation wants to react on further model manipulations, it should register an adapter on the model element; no further notifications will occur.
stereotypeApplied
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
element
- The model element to which the given stereotype was applied.stereotype
- The stereotype which was returned by #getMatchingStereotype(List, String)
and which was
applied to the given element.eaStereotypes
- The complete list of applied stereotypes as strings as found in the EA database; might be fully
qualified or simple format.public java.util.Map<java.lang.String,java.lang.String> getStereotypePropertyMap(java.lang.String stereotypeFqn)
com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
getStereotypePropertyMap
in interface com.yakindu.bridges.ea.uml.contributors.IStereotypeResolver
stereotypeFqn
- The fully qualified name of a stereotype as registered in the corresponding Eclipse UML profile.null
or empty.Copyright (c) 2015 itemis AG, and others. All rights reserved.