use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.
the class EMV2RootImpl method basicSetLibrary.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetLibrary(ErrorModelLibrary newLibrary, NotificationChain msgs) {
ErrorModelLibrary oldLibrary = library;
library = newLibrary;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ErrorModelPackage.EMV2_ROOT__LIBRARY, oldLibrary, newLibrary);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.
the class ErrorModelValidator method checkUniqueInheritedDefiningErrorTypes.
private void checkUniqueInheritedDefiningErrorTypes(ErrorModelLibrary etl, Hashtable<String, EObject> types) {
for (ErrorTypes et : etl.getTypes()) {
if (types.containsKey(et.getName())) {
EObject source = types.get(et.getName());
ErrorModelLibrary eml = EMV2Util.getContainingErrorModelLibrary(et);
error(source, "Error type or type set (alias) " + et.getName() + " inherited from " + EMV2Util.getPrintName(eml) + " conflicts with another defining identifier in error type library");
}
types.put(et.getName(), et);
}
for (ErrorModelLibrary xetl : etl.getExtends()) {
checkUniqueInheritedDefiningErrorTypes(xetl, types);
}
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.
the class ErrorModelValidator method checkUniqueDefiningIdentifiers.
private void checkUniqueDefiningIdentifiers(ErrorModelLibrary etl, boolean cyclicextends) {
Hashtable<String, EObject> types = new Hashtable<String, EObject>(10, 10);
checkUniqueDefiningEBSMMappingsTransformations(etl, types);
if (cyclicextends) {
return;
}
for (ErrorModelLibrary xetl : etl.getExtends()) {
checkUniqueInheritedDefiningErrorTypes(xetl, types);
}
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.
the class EMV2TypeSetUtil method getAllLeafSubTypes.
/**
* get list of leaf subtypes of the given error type et excluding et itself
* Each any error type alias has been resolved
* @param context
* @param et
* @return
*/
public static EList<ErrorType> getAllLeafSubTypes(ErrorType et, List<ErrorModelLibrary> usetypes) {
EList<ErrorType> result = new UniqueEList<ErrorType>();
EList<ErrorType> removeMe = new UniqueEList<ErrorType>();
for (ErrorModelLibrary etl : usetypes) {
EList<ErrorType> typeslist = etl.getTypes();
for (ErrorType errorType : typeslist) {
ErrorType set = EMV2Util.resolveAlias(errorType);
if (contains(et, set)) {
result.add(set);
}
if (set.getSuperType() != null) {
removeMe.add(set.getSuperType());
}
}
}
result.removeAll(removeMe);
return result;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorModelLibrary in project osate2 by osate.
the class EMV2TypeSetUtil method getAllLeafSubTypes.
public static EList<ErrorType> getAllLeafSubTypes(ErrorType et, ErrorModelLibrary el) {
EList<ErrorType> result = new UniqueEList<ErrorType>();
EList<ErrorType> removeMe = new UniqueEList<ErrorType>();
Iterable<ErrorType> typeslist = ErrorModelUtil.getAllErrorTypes(el);
for (ErrorType errorType : typeslist) {
ErrorType set = EMV2Util.resolveAlias(errorType);
if (contains(et, set) && (et != set)) {
result.add(set);
}
if (set.getSuperType() != null) {
removeMe.add(set.getSuperType());
}
}
result.removeAll(removeMe);
return result;
}
Aggregations