use of org.osate.xtext.aadl2.errormodel.errorModel.TypeMappingSet in project osate2 by osate.
the class ErrorPathImpl method setTypeMappingSet.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTypeMappingSet(TypeMappingSet newTypeMappingSet) {
TypeMappingSet oldTypeMappingSet = typeMappingSet;
typeMappingSet = newTypeMappingSet;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_PATH__TYPE_MAPPING_SET, oldTypeMappingSet, typeMappingSet));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.TypeMappingSet in project osate2 by osate.
the class ErrorModelSubclauseImpl method setTypeMappingSet.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setTypeMappingSet(TypeMappingSet newTypeMappingSet) {
TypeMappingSet oldTypeMappingSet = typeMappingSet;
typeMappingSet = newTypeMappingSet;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, ErrorModelPackage.ERROR_MODEL_SUBCLAUSE__TYPE_MAPPING_SET, oldTypeMappingSet, typeMappingSet));
}
use of org.osate.xtext.aadl2.errormodel.errorModel.TypeMappingSet 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.TypeMappingSet in project osate2 by osate.
the class EMV2Util method getAllTypeEquivalenceMapping.
/**
* return type mapping set to be used for bindings other than connection bindings.
* Looks for use type equivalence in classifier or inherited from classifiers being extended
* Also look in parent component instances, i.e., the equivalence mapping is inherited down the component hierarchy
* @param ci Component Instance
* @return TypeMappingSet
*/
public static TypeMappingSet getAllTypeEquivalenceMapping(ComponentInstance ci) {
while (ci != null) {
EList<ErrorModelSubclause> emslist = getAllContainingClassifierEMV2Subclauses(ci);
for (ErrorModelSubclause errorModelSubclause : emslist) {
TypeMappingSet tms = errorModelSubclause.getTypeEquivalence();
if (tms != null) {
return tms;
}
}
ci = ci.getContainingComponentInstance();
}
return null;
}
use of org.osate.xtext.aadl2.errormodel.errorModel.TypeMappingSet in project osate2 by osate.
the class EMV2TypeSetUtil method reverseMapTypeToken.
/**
* map a TypeToken from the target type token to the first type token in the source type set according to the TypeMappingSet.
* The original token is not modified.
* The result token is currently that from the mapping rule and is not expected to be modified
* @param token TypeToken
* @param tms TypeMappingSet
* @return result TypeToken or null if no mapping found
*/
public static TypeToken reverseMapTypeToken(TypeToken token, TypeMappingSet tms) {
EList<TypeMapping> tmlist = tms.getMapping();
for (TypeMapping typeMapping : tmlist) {
TypeSet src = typeMapping.getSource();
TypeSet trg = typeMapping.getTarget();
if (contains(trg, token)) {
return src.getTypeTokens().get(0);
}
}
return null;
}
Aggregations