use of org.osate.aadl2.ComponentType in project osate2 by osate.
the class Aadl2RenameStrategy method setName.
@Override
protected EObject setName(URI targetElementURI, String newName, ResourceSet resourceSet) {
EObject targetElement = super.setName(targetElementURI, newName, resourceSet);
if (targetElement == null) {
throw new RefactoringException("Target element not loaded.");
}
if (targetElement instanceof ComponentImplementation && !newName.contains(".")) {
ComponentImplementation ci = (ComponentImplementation) targetElement;
ComponentType ct = ci.getType();
newName = ct.getName() + "." + newName;
ci.setName(newName);
}
return targetElement;
}
use of org.osate.aadl2.ComponentType in project osate2 by osate.
the class SetExtendedClassifierPropertySection method getExtensibleClassifierDescriptions.
/**
* Return a list of EObjectDescriptions for classifiers that could be extended.
* The result will includes null since extending no classifier is a valid option.
* @return
*/
private List<IEObjectDescription> getExtensibleClassifierDescriptions(final Classifier classifier) {
final List<IEObjectDescription> objectDescriptions = new ArrayList<IEObjectDescription>();
objectDescriptions.add(null);
final String name = classifier.getQualifiedName();
// Populate the list with valid classifier descriptions
if (name != null) {
for (final IEObjectDescription desc : AadlModelAccessUtil.getAllEObjectsByType(classifier.eResource(), classifier.eClass())) {
if (!name.equalsIgnoreCase(desc.getName().toString("::"))) {
objectDescriptions.add(desc);
}
}
// Ensure that abstract classifiers are in the list
if (classifier instanceof ComponentType) {
if (classifier.eClass() != Aadl2Package.eINSTANCE.getAbstractType()) {
for (final IEObjectDescription desc : AadlModelAccessUtil.getAllEObjectsByType(classifier.eResource(), Aadl2Package.eINSTANCE.getAbstractType())) {
if (!name.equalsIgnoreCase(desc.getName().toString("::"))) {
objectDescriptions.add(desc);
}
}
}
} else if (classifier instanceof ComponentImplementation) {
if (classifier.eClass() != Aadl2Package.eINSTANCE.getAbstractImplementation()) {
for (final IEObjectDescription desc : AadlModelAccessUtil.getAllEObjectsByType(classifier.eResource(), Aadl2Package.eINSTANCE.getAbstractImplementation())) {
if (!name.equalsIgnoreCase(desc.getName().toString("::"))) {
objectDescriptions.add(desc);
}
}
}
}
}
return objectDescriptions;
}
use of org.osate.aadl2.ComponentType in project osate2 by osate.
the class SubcomponentImpl method getAllFeatures.
/**
* Get list of all features of a subcomponent, including ancestor features
* These are the features of its classifier
* In case of refined features the refined feature is returned in the list.
* @return List of features
*/
public EList<Feature> getAllFeatures() {
ComponentImplementation ci = getComponentImplementation();
if (ci != null) {
return ci.getAllFeatures();
}
ComponentType ct = getComponentType();
if (ct != null) {
return ct.getAllFeatures();
}
return ECollections.emptyEList();
}
use of org.osate.aadl2.ComponentType in project osate2 by osate.
the class AadlBusinessObjectProvider method getAllDefaultAnnexSubclauses.
/**
* Returns all the default annex subclauses owned by a classifier or any extended or implemented classifiers.
* @param topClassifier
* @return
*/
private static EList<AnnexSubclause> getAllDefaultAnnexSubclauses(final Classifier topClassifier) {
final EList<AnnexSubclause> result = new BasicEList<AnnexSubclause>();
if (topClassifier == null) {
return result;
}
final EList<Classifier> classifiers = topClassifier.getSelfPlusAllExtended();
if (topClassifier instanceof ComponentImplementation) {
ComponentType ct = ((ComponentImplementation) topClassifier).getType();
if (ct != null) {
// May be null in the case of an invalid model.
final EList<Classifier> tclassifiers = ct.getSelfPlusAllExtended();
classifiers.addAll(tclassifiers);
}
}
for (Classifier classifier : classifiers) {
result.addAll(classifier.getOwnedAnnexSubclauses());
}
return result;
}
use of org.osate.aadl2.ComponentType in project osate2 by osate.
the class AssuranceCaseImpl method setSystem.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setSystem(ComponentType newSystem) {
ComponentType oldSystem = system;
system = newSystem;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, AlisaPackage.ASSURANCE_CASE__SYSTEM, oldSystem, system));
}
Aggregations