use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorType in project osate2 by osate.
the class EMV2PathElementImpl method setErrorType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setErrorType(ErrorTypes newErrorType) {
ErrorTypes oldErrorType = errorType;
errorType = newErrorType;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.EMV2_PATH_ELEMENT__ERROR_TYPE, oldErrorType, errorType));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorType in project osate2 by osate.
the class ErrorModelValidator method checkTypeMappingSet.
/**
* @since 6.1
*/
public void checkTypeMappingSet(TypeMappingSet tms) {
int size = tms.getMapping().size();
for (int i = 0; i < size; i++) {
TypeSet ts = tms.getMapping().get(i).getTarget();
TypeToken tt = ts.getTypeTokens().get(0);
if (tt != null && tt.getType() != null && (!(tt.getType().get(0) instanceof ErrorType) || ts.getTypeTokens().size() > 1)) {
error(tms.getMapping().get(i), "Target error type may only have a single error type");
}
}
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorType in project osate2 by osate.
the class EMV2Util method getContainmentErrorType.
/**
* get error type (last element of containment path, if present
* Otherwise return null
* @param containedNamedElement Containment path
* @return EList<ErrorType>
*/
public static ErrorType getContainmentErrorType(ContainedNamedElement containedNamedElement) {
EList<ContainmentPathElement> cpes = containedNamedElement.getContainmentPathElements();
if (!cpes.isEmpty()) {
ContainmentPathElement cpe = cpes.get(cpes.size() - 1);
NamedElement appliestome = cpe.getNamedElement();
if (appliestome instanceof ErrorType) {
return ((ErrorType) appliestome);
}
}
return null;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorType in project osate2 by osate.
the class ErrorModelValidator method checkCyclicExtends.
private void checkCyclicExtends(ErrorType origet) {
ErrorType et = EMV2Util.resolveAlias(origet);
if (et.getSuperType() == null) {
return;
}
HashSet<ErrorType> result = new HashSet<ErrorType>();
while (et.getSuperType() != null) {
result.add(et);
ErrorType last = et;
et = EMV2Util.resolveAlias(et.getSuperType());
if (result.contains(et)) {
error(origet, "Cycle in supertype hierarchy of error type " + origet.getName() + " at type " + last.getName());
return;
}
}
}
use of org.osate.xtext.aadl2.errormodel.errorModel.ErrorType in project osate2 by osate.
the class EMV2Util method getName.
public static String getName(EList<TypeToken> tul) {
boolean docomma = false;
String res = "";
for (TypeToken typeSetElement : tul) {
EList<ErrorTypes> et = typeSetElement.getType();
if (docomma) {
res = res + ',';
} else {
docomma = true;
}
if (et != null && !et.isEmpty()) {
boolean doproduct = false;
for (ErrorTypes errorType : et) {
if (doproduct) {
res = res + "*";
} else {
doproduct = true;
}
res = res + errorType.getName();
}
}
}
return res;
}
Aggregations