|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.aadl.modelsupport.util.AadlUtil
public final class AadlUtil
Static utility methods for processing AADL meta model objects.
Method Summary | ||
---|---|---|
static boolean |
canImplement(ComponentImplementation impl,
ComponentType type)
Check to see that a component type and a component implementation have the same category |
|
static boolean |
canImplement(FlowImplementation fi,
FlowSpecification fs)
Check whether the flow specification and flow implementation are both flow paths, flow sources, or flow sinks |
|
static
|
copyList(java.util.List<? extends T> list)
Returns a list of the self-contained copies of each EObject in
the given list. |
|
static int |
countElementsBySubclass(Element root,
java.lang.Class clazz)
For the subtree rooted at the given node, count the number of model elements whose class extends from the given model element type. |
|
static ConnectionInstance |
findConnectionInstance(InstanceObject src,
InstanceObject dst)
find the connection instance with src as its source and dst as its destination |
|
static org.eclipse.emf.common.util.EList<NamedElement> |
findDoubleNamedElementsInList(java.util.List<?> el)
Check to see if all NamedElements in the Elist have a unique name. |
|
static Element |
findElement(Element modelelement,
int location)
Find the Element whose location reference is close to the line number. |
|
static org.eclipse.emf.ecore.EClass |
findMetaModelClass(java.lang.String classname)
find Meta model class object in meta model packages |
|
static NamedElement |
findNamedElementInList(java.util.List<?> el,
java.lang.String name)
find (first) Named Element matching name in the Elist; any elements that are not NamedElements are skipped. |
|
static org.eclipse.emf.common.util.EList<NamedElement> |
findNamedElementsInList(java.util.List<?> el,
java.lang.String name)
find all Named Elements matching name in the Elist; any elements that are not NamedElements are skipped. |
|
static org.eclipse.emf.common.util.EList<ComponentImplementation> |
getAllComponentImpl()
Get all component implementations; in all anon. name spaces and from all packages (public and private parts) |
|
static org.eclipse.emf.common.util.EList<Property> |
getAllPropertyDefinitions()
Get all the property definitions. |
|
static org.eclipse.emf.common.util.EList<Property> |
getAllUsedPropertyDefinition(SystemImplementation si)
Get all property definitions that are used in the Aadl model. |
|
static Element |
getElement(java.lang.Object object)
Try to generate an Element from an object. |
|
static org.eclipse.emf.common.util.EList<FeatureGroupConnection> |
getFeatureGroupConnection(java.util.Collection<?> portconn)
extract the set of feature group connections from the list of connections |
|
static Element |
getInstanceOrigin(InstanceObject io)
|
|
static java.lang.String |
getName(org.eclipse.emf.common.util.URI uri)
extracts the name of the model object referenced by the uri The name is looked up if the uri format is that of AADL XPath returns null if the uri points to an unnamed model object |
|
static org.eclipse.emf.common.util.EList<FeatureGroupConnection> |
getPortGroupConnection(java.util.Collection<? extends Connection> portconn)
extract the set of feature group connections from the list of connections |
|
static java.lang.String |
getQualifiedClassName(java.lang.String classname)
find Meta model class in meta model packages |
|
static java.lang.String |
getQualifiedName(org.eclipse.emf.common.util.URI uri)
|
|
static boolean |
hasOutgoingPortSubcomponents(org.eclipse.emf.common.util.EList<? extends ComponentInstance> subcompinstances)
determine whether a component instance has subcomponents that can have outgoing connections |
|
static boolean |
hasPortComponents(ComponentImplementation compimpl)
determine whether a component instance has subcomponents with ports |
|
static boolean |
isOutgoingPort(Feature f)
determine whether the feature is an outgoing port or feature group |
|
static void |
makeSureFoldersExist(org.eclipse.core.runtime.IPath path)
make sure the parent folders exist. |
|
static boolean |
matchingClassifier(Classifier source,
Classifier dest)
check to see that the source classifier matches that of the destination implementations must be the same, types must be the same; if the source is an implementation and the destination is a type their types must match In case of the feature group the feature group types must match |
|
static boolean |
oncePerMode(java.util.List<? extends ModalElement> list,
java.util.List<? extends Mode> allModes)
Check to ensure that there is at most one list element per mode |
|
static boolean |
sameCategory(Subcomponent sub,
ComponentClassifier c)
Check to see if the category of the subcomponent and the classifier match |
|
static boolean |
sameEClass(org.eclipse.emf.ecore.EObject c1,
org.eclipse.emf.ecore.EObject c2)
Compare the EClass of the two EObjects |
|
static boolean |
uniqueNamedElementList(java.util.List<?> el)
Check to see if all NamedElements in the Elist have a unique name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static NamedElement findNamedElementInList(java.util.List<?> el, java.lang.String name)
el
- Elist of NamedElementsname
- String
public static org.eclipse.emf.common.util.EList<NamedElement> findNamedElementsInList(java.util.List<?> el, java.lang.String name)
el
- Elist of NamedElementsname
- String
public static org.eclipse.emf.common.util.EList<NamedElement> findDoubleNamedElementsInList(java.util.List<?> el)
el
- EList or NamedElements or other objects
public static boolean uniqueNamedElementList(java.util.List<?> el)
el
- EList or NamedELements or other objects
public static boolean sameEClass(org.eclipse.emf.ecore.EObject c1, org.eclipse.emf.ecore.EObject c2)
c1
- EObjectc2
- EObject
public static boolean oncePerMode(java.util.List<? extends ModalElement> list, java.util.List<? extends Mode> allModes)
list
- list of ModeMembers
public static boolean canImplement(FlowImplementation fi, FlowSpecification fs)
fi
- flow implementationfs
- flow specification
public static boolean canImplement(ComponentImplementation impl, ComponentType type)
impl
- ComponentImplementationtype
- ComponentType
public static boolean sameCategory(Subcomponent sub, ComponentClassifier c)
sub
- Subcomponentc
- ComponentClassifier
public static boolean matchingClassifier(Classifier source, Classifier dest)
source
- Classifierdest
- Classifier
public static org.eclipse.emf.common.util.EList<FeatureGroupConnection> getFeatureGroupConnection(java.util.Collection<?> portconn)
portconn
- list of port connections
public static <T extends org.eclipse.emf.ecore.EObject> java.util.List<T> copyList(java.util.List<? extends T> list)
EObject
in
the given list.
list
- the list of objects to copy.
EcoreUtil.copy(org.eclipse.emf.ecore.EObject)
public static Element getElement(java.lang.Object object)
Element
from an object.
This method is intended to be used with objects that obtained from a
selection event, i.e., from the
ISelectionChangedListener.selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
method.
If the object is an Element, it is returned. Otherwise, the method tries to adapt the object to an Element.
object
- The object to get an Element from.
null
if no Element can be obtained
from the given object.public static java.lang.String getQualifiedClassName(java.lang.String classname)
classname
- the class name to be qualified with the package name
public static org.eclipse.emf.ecore.EClass findMetaModelClass(java.lang.String classname)
classname
- the class name to be found
public static Element findElement(Element modelelement, int location)
modelelement
- The model element used as root of the searchlocation
- line number
public static java.lang.String getQualifiedName(org.eclipse.emf.common.util.URI uri)
public static java.lang.String getName(org.eclipse.emf.common.util.URI uri)
uri
- refering to a model object
public static Element getInstanceOrigin(InstanceObject io)
public static int countElementsBySubclass(Element root, java.lang.Class clazz)
int numSubs = AadlUtil.countElementsBySubclass(root, Subcomponent.class);
root
- The root of the subtree.clazz
- The class to count instances of.
public static boolean hasPortComponents(ComponentImplementation compimpl)
subcompinstances
- list of sub component instancespublic static void makeSureFoldersExist(org.eclipse.core.runtime.IPath path)
path
- public static org.eclipse.emf.common.util.EList<Property> getAllPropertyDefinitions()
public static boolean hasOutgoingPortSubcomponents(org.eclipse.emf.common.util.EList<? extends ComponentInstance> subcompinstances)
subcompinstances
- list of sub component instancespublic static boolean isOutgoingPort(Feature f)
f
- Feature
public static org.eclipse.emf.common.util.EList<FeatureGroupConnection> getPortGroupConnection(java.util.Collection<? extends Connection> portconn)
portconn
- list of port connections
public static ConnectionInstance findConnectionInstance(InstanceObject src, InstanceObject dst)
src
- InstanceObjectdst
- InstanceObject
public static org.eclipse.emf.common.util.EList<Property> getAllUsedPropertyDefinition(SystemImplementation si)
si
- System Implementation
public static org.eclipse.emf.common.util.EList<ComponentImplementation> getAllComponentImpl()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |