|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.cmu.sei.aadl.model.util.AadlUtil
public final class AadlUtil
Static utility methods for processing AADL meta model objects.
Method Summary | |
---|---|
static boolean |
addClassifier(AObject nameSpace,
Classifier classifier)
add classifier to the name space. |
static boolean |
canImplement(ComponentImpl impl,
ComponentType type)
Check to see that a component type and a component implementation have the same category |
static boolean |
canImplement(FlowImpl fi,
FlowSpec fs)
Check whether the flow spec and flow impl are both flow paths, flow sources, or flow sinks |
static java.util.List<org.eclipse.emf.ecore.EObject> |
copyList(java.util.List list)
Returns a list of the self-contained copies of each EObject
in the given list. |
static int |
countElementsBySubclass(AObject 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 int |
countElementsBySubclass(AObject root,
java.lang.Class[] classes)
For the subtree rooted at the given node, count the number of model elements whose class extends from one of the given model element types. |
static int |
countElementsExactClass(AObject root,
java.lang.Class clazz)
For the subtree rooted at the given node, count the number of model elements whose class is the given model element type. |
static int |
countElementsExactClass(AObject root,
java.lang.Class[] classes)
For the subtree rooted at the given node, count the number of model elements whose class is one of the given model element types. |
static AObject |
findAObject(AObject modelelement,
int location)
find the Aobject whose location reference is close to the line number |
static Classifier |
findClassifierInNameSpace(AObject fromNS,
NamedElementReference ner)
Find a component classifier by name. |
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 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<ComponentImpl> |
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<PropertyDefinition> |
getAllPropertyDefinition()
Get all the properties defined in the global property sets. |
static org.eclipse.emf.common.util.EList<PropertyDefinition> |
getAllPropertyDefinition(AObject context)
Get all the property definitions, including those defined in any local property sets. |
static java.util.List<AadlPackage> |
getAllUsedPackages(ComponentType ct)
get list of packages referenced by the features of the specified component type recurseively consider the features in port groups |
static org.eclipse.emf.common.util.EList<AadlPackage> |
getAllUsedPackages(java.util.List<? extends AObject> aobjlist)
get list of packages referenced by the features of the specified list of component classifiers or port group classifiers recursively consider the features in port groups |
static org.eclipse.emf.common.util.EList<PropertyDefinition> |
getAllUsedPropertyDefinition(SystemImpl si)
Get all property definitions that are used in the Aadl model. |
static org.eclipse.emf.common.util.EList |
getAllVisibleComponentClassifiers(AObject aobj,
ComponentCategory compCat)
Get all component classifiers that are visible from the given aobject. |
static org.eclipse.emf.common.util.EList<ComponentImpl> |
getAllVisibleComponentImpls(AObject aobj,
ComponentCategory compCat)
Get all component implementations that are visible from the given aobject. |
static org.eclipse.emf.common.util.EList<ComponentType> |
getAllVisibleComponentTypes(AObject aobj,
ComponentCategory compCat)
Get all component types that are visible from the given aobject. |
static org.eclipse.emf.common.util.EList |
getAllVisiblePortGroupTypes(AObject aobj)
Get all Port Group Types that are visible from the given aobject. |
static AObject |
getAObject(java.lang.Object object)
Try to generate an AObject from an
object. |
static ComponentClassifier |
getComponentClassifierSelection(ComponentInstance ci)
get the ComponentClassifierSelection for a component instance The selection is determined by the classifier of the subcomponent, and may be overridden by a ComponentClassifierSelection property value. |
protected static ComponentClassifier |
getComponentClassifierSelection(java.util.List proplist,
java.util.List<Subcomponent> target)
get ComponentClassifier from ComponentClassifierSelection property Find it in the property list |
static org.eclipse.emf.common.util.EList<ComponentClassifier> |
getDeclarationOrderedComponentClassifiers(AObject aobj)
get a sorted list of component classifier declaratations It is sorted such that subcomponents in component implementations refer to previously declared component types or implementations |
static AObject |
getInstanceOrigin(InstanceObject io)
returns a single AObject that represents the origin of the instance object In case of connection instances the connection declaration from out to in is used. |
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<PortGroupConnection> |
getPortGroupConnection(java.util.Collection portconn)
extract the set of port 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 org.eclipse.emf.common.util.URI |
getURI(org.eclipse.emf.ecore.EObject eObject)
Returns a URI for the eObject, i.e., either the eProxyURI, the URI of the eResource with the fragment produced by the eResource, or the URI consisting of just the fragment that would be produced by a default Resource with the eObject as its only contents. |
static java.util.List<AadlPackage> |
getUsedPackages(ComponentImpl ci)
get list of packages referenced by the features of the specified component type |
static java.util.List<AadlPackage> |
getUsedPackages(ComponentType ct)
get list of packages referenced by the features of the specified component type |
static org.eclipse.emf.common.util.EList<AadlPackage> |
getUsedPackages(java.util.List<? extends AObject> aobjlist)
get list of packages referenced by the features of the specified list of component classifiers or port group classifiers |
static java.util.List<AadlPackage> |
getUsedPackages(PortGroupType pgt)
get list of packages referenced by the features of the specified port group type |
static boolean |
hasAccessSource(org.eclipse.emf.common.util.EList subcompinstances)
determine whether a component instance has subcomponents that can have outgoing connections |
static boolean |
hasClassifier(AObject obj)
Does the object have a classifier reference |
static boolean |
hasOutgoingPortSubcomponents(org.eclipse.emf.common.util.EList subcompinstances)
determine whether a component instance has subcomponents that can have outgoing connections |
static boolean |
hasPortComponents(ComponentImpl compimpl)
determine whether a component instance has subcomponents with ports |
static boolean |
isContainedIn(ComponentInstance childci,
ComponentInstance parentci)
determine whether two feature instances are the same or one is contained in the other |
static boolean |
isokClassifierSubstitution(Classifier origin,
Classifier replacement)
checks for legal classifier substitution. |
static boolean |
isokTypeSubstitution(ComponentType origin,
ComponentType reptype)
checks for legal type substitution. |
static boolean |
isOutgoingAccess(Feature f)
determine whether a feature is an outgoing access feature |
static boolean |
isOutgoingFeature(Feature f)
determine whether a feature can have outgoing connections |
static boolean |
isOutgoingPort(Feature f)
determine whether the feature is an outgoing port or port group |
static boolean |
isSameOrContainedIn(FeatureInstance firstfi,
FeatureInstance secondfi)
determine whether two feature instances are the same or one is contained in the other |
static boolean |
isSameOrExtends(Classifier origin,
Classifier repl)
return true if repl is the same classifier or an extension of the original |
static boolean |
isSameOrRefined(Connection firstconn,
Connection secondconn)
determine whether two connections are the same or one is a refinement of the other |
static boolean |
isSameOrRefined(Feature firstfi,
Feature secondfi)
determine whether two features are the same or one is a refinement of the other |
static boolean |
isSameOrRefined(Subcomponent firstfi,
Subcomponent secondfi)
determine whether two subcomponents are the same or one is a refinement of the other |
static void |
makeSureFoldersExist(org.eclipse.core.runtime.IPath path)
make sure the parent folders exist. |
static boolean |
match(FeatureContext firstfxt,
FeatureContext secondfxt)
determine whether two feature context match |
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 impl and the destination is a type their types must match In case of the port group the port group types must match |
static boolean |
oncePerMode(java.util.List list,
java.util.List allModes)
Check to ensure that there is at most one list element per mode |
static java.lang.String |
ownPackage(AObject o,
java.lang.String str)
Removes packagename if current package |
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 list, java.util.List allModes)
list
- list of ModeMembers
public static org.eclipse.emf.common.util.EList<ComponentImpl> getAllComponentImpl()
public static org.eclipse.emf.common.util.EList getAllVisibleComponentClassifiers(AObject aobj, ComponentCategory compCat)
aobj
- AObject
public static org.eclipse.emf.common.util.EList<ComponentType> getAllVisibleComponentTypes(AObject aobj, ComponentCategory compCat)
aobj
- AObject
public static org.eclipse.emf.common.util.EList<ComponentImpl> getAllVisibleComponentImpls(AObject aobj, ComponentCategory compCat)
aobj
- AObject
public static org.eclipse.emf.common.util.EList getAllVisiblePortGroupTypes(AObject aobj)
aobj
- AObject
public static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllPropertyDefinition()
public static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllPropertyDefinition(AObject context)
context
- The model object on whose behalf the lookup is being
performed. See
OsateResourceManager.findPropertySet(String, AObject)
.public static org.eclipse.emf.common.util.EList<PropertyDefinition> getAllUsedPropertyDefinition(SystemImpl si)
si
- System Implementation
public static boolean canImplement(FlowImpl fi, FlowSpec fs)
fi
- flow implementationfs
- flow specification
public static boolean canImplement(ComponentImpl impl, ComponentType type)
impl
- ComponentImpltype
- ComponentType
public static boolean sameCategory(Subcomponent sub, ComponentClassifier c)
sub
- Subcomponentc
- ComponentClassifier
public static java.lang.String ownPackage(AObject o, java.lang.String str)
o
- that contains the classsifier referencestr
-
public static Classifier findClassifierInNameSpace(AObject fromNS, NamedElementReference ner)
fromNS
- The package where to start the search (AadlSpec or
AadlPackageSection). Necessary to determine namespace.ner
- Identification of the classifier to find.
public static org.eclipse.emf.common.util.EList<ComponentClassifier> getDeclarationOrderedComponentClassifiers(AObject aobj)
aobj
-
public static boolean matchingClassifier(Classifier source, Classifier dest)
source
- Classifierdest
- Classifier
public static boolean isokClassifierSubstitution(Classifier origin, Classifier replacement)
origin
- Classifierreplacement
- Classifier
public static boolean isokTypeSubstitution(ComponentType origin, ComponentType reptype)
origin
- Component typereptype
- type Component type
public static boolean isSameOrExtends(Classifier origin, Classifier repl)
origin
- Classifierrepl
- Classifier
public static org.eclipse.emf.common.util.EList<PortGroupConnection> getPortGroupConnection(java.util.Collection portconn)
portconn
- list of port connections
public static java.util.List<org.eclipse.emf.ecore.EObject> copyList(java.util.List list)
EObject
in the given list.
list
- the list of objects to copy.
EcoreUtil.copy(org.eclipse.emf.ecore.EObject)
public static org.eclipse.emf.common.util.EList<AadlPackage> getUsedPackages(java.util.List<? extends AObject> aobjlist)
aobjlist
-
public static org.eclipse.emf.common.util.EList<AadlPackage> getAllUsedPackages(java.util.List<? extends AObject> aobjlist)
aobjlist
-
public static java.util.List<AadlPackage> getUsedPackages(ComponentType ct)
ct
- ComponentType
public static java.util.List<AadlPackage> getAllUsedPackages(ComponentType ct)
ct
- ComponentType
public static java.util.List<AadlPackage> getUsedPackages(ComponentImpl ci)
ci
- ComponentImpl
public static java.util.List<AadlPackage> getUsedPackages(PortGroupType pgt)
pgt
- PortGroupType
public static AObject getAObject(java.lang.Object object)
AObject
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 AObject, it is returned. Otherwise, the method tries to adapt the object to an AObject.
object
- The object to get an AObject from.
null
if no AObject 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 AObject findAObject(AObject 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 boolean addClassifier(AObject nameSpace, Classifier classifier)
nameSpace
- an AadlSpec, AadlPackageSectionclassifier
- public static ConnectionInstance findConnectionInstance(InstanceObject src, InstanceObject dst)
src
- InstanceObjectdst
- InstanceObject
public static AObject getInstanceOrigin(InstanceObject io)
io
- InstanceObject
public static boolean hasClassifier(AObject obj)
obj
- AObject
public static int countElementsBySubclass(AObject 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 int countElementsBySubclass(AObject root, java.lang.Class[] classes)
int count = AadlUtil.countElementsBySubclass(root, new Class[] { DataClassifier.class, BusClassifier.class });
root
- The root of the subtree.classes
- The classes to count instances of.
public static int countElementsExactClass(AObject root, java.lang.Class clazz)
int count = AadlUtil.countElementsExactClass(root, DataType.class);
root
- The root of the subtree.clazz
- The class to count instances of.
public static int countElementsExactClass(AObject root, java.lang.Class[] classes)
int count = AadlUtil.countElementsBySubclass(root, new Class[] { DataType.class, BusType.class });
root
- The root of the subtree.classes
- The classes to count instances of.
public static org.eclipse.emf.common.util.URI getURI(org.eclipse.emf.ecore.EObject eObject)
eObject
- the object for which to get the URI.
public static ComponentClassifier getComponentClassifierSelection(ComponentInstance ci)
protected static ComponentClassifier getComponentClassifierSelection(java.util.List proplist, java.util.List<Subcomponent> target)
proplist
- EList of property associationstarget
- subcomponent list to be matched by applies to. Empty list is ok.
public static boolean hasOutgoingPortSubcomponents(org.eclipse.emf.common.util.EList subcompinstances)
subcompinstances
- list of sub component instancespublic static boolean hasAccessSource(org.eclipse.emf.common.util.EList subcompinstances)
subcompinstances
- list of sub component instancespublic static boolean isOutgoingAccess(Feature f)
f
- Feature
public static boolean isOutgoingPort(Feature f)
f
- Feature
public static boolean isOutgoingFeature(Feature f)
f
- Feature
public static boolean hasPortComponents(ComponentImpl compimpl)
subcompinstances
- list of sub component instancespublic static boolean match(FeatureContext firstfxt, FeatureContext secondfxt)
firstfxt
- feature contextsecondfxt
- feature context
public static boolean isSameOrContainedIn(FeatureInstance firstfi, FeatureInstance secondfi)
firstfi
- feature instancesecondfi
- feature instance that may be a port group
public static boolean isSameOrRefined(Feature firstfi, Feature secondfi)
firstfi
- featuresecondfi
- feature
public static boolean isSameOrRefined(Connection firstconn, Connection secondconn)
firstconn
- Connectionsecondconn
- Connection
public static boolean isSameOrRefined(Subcomponent firstfi, Subcomponent secondfi)
firstfi
- subcomponentsecondfi
- subcomponent
public static boolean isContainedIn(ComponentInstance childci, ComponentInstance parentci)
childci
- component instanceparentci
- feature instance that may be a port group
public static void makeSureFoldersExist(org.eclipse.core.runtime.IPath path)
path
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |