use of org.osate.xtext.aadl2.errormodel.errorModel.TypeToken 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.TypeToken in project osate2 by osate.
the class ErrorModelValidator method checkTypePropagationAndContainment.
private void checkTypePropagationAndContainment(ErrorPropagation ep) {
ErrorPropagation epopposite;
if (ep.isNot()) {
// do it only for propagation, so we do not get double messages.
return;
}
epopposite = EMV2Util.findErrorContainment(ep.getContainingClassifier(), EMV2Util.getPrintName(ep), ep.getDirection());
if (epopposite == null) {
return;
}
BasicEList<TypeToken> res = EMV2TypeSetUtil.getTypeSetIntersection(ep.getTypeSet(), epopposite.getTypeSet());
if (!res.isEmpty()) {
error(ep, "Error propagation and containment " + EMV2Util.getPrintName(ep) + " have a common error type or type product " + EMV2Util.getPrintName(res));
}
}
use of org.osate.xtext.aadl2.errormodel.errorModel.TypeToken in project osate2 by osate.
the class ErrorModelValidator method checkTransitionTargetTypes.
private void checkTransitionTargetTypes(TransitionBranch ebt) {
if (ebt.isSteadyState()) {
return;
}
ErrorBehaviorState ebs = ebt.getTarget();
if (ebs != null) {
TypeSet ebsTS = ebs.getTypeSet();
TypeSet tt = ebt.getTargetToken();
if (tt == null || tt.getTypeTokens().isEmpty()) {
return;
}
TypeToken ebtargetTS = tt.getTypeTokens().get(0);
if (ebtargetTS == null) {
return;
}
if (ebsTS == null && ebtargetTS != null) {
error(ebt, "Target state " + ebs.getName() + " does not have a type set declared but the transition target specifies " + EMV2Util.getPrintName(ebtargetTS));
} else if (!EMV2TypeSetUtil.contains(ebsTS, ebtargetTS)) {
error(ebt, "Target type " + EMV2Util.getPrintName(ebt.getTargetToken()) + " is not contained in type set of error behavior state \'" + ebs.getName() + "\'");
}
}
}
use of org.osate.xtext.aadl2.errormodel.errorModel.TypeToken in project osate2 by osate.
the class OutgoingPropagationConditionImpl method basicSetTypeToken.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public NotificationChain basicSetTypeToken(TypeSet newTypeToken, NotificationChain msgs) {
TypeSet oldTypeToken = typeToken;
typeToken = newTypeToken;
if (eNotificationRequired()) {
ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ErrorModelPackage.OUTGOING_PROPAGATION_CONDITION__TYPE_TOKEN, oldTypeToken, newTypeToken);
if (msgs == null)
msgs = notification;
else
msgs.add(notification);
}
return msgs;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.TypeToken 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