use of org.osate.ba.aadlba.BehaviorElement in project osate2 by osate.
the class AadlBaNameResolver method propertySetpropertyReferenceResolver.
private boolean propertySetpropertyReferenceResolver(DeclarativePropertyReference ref) {
Identifier propertyNameId = ref.getPropertyNames().get(0).getPropertyName();
String packageName = null;
if (ref.getQualifiedName() != null) {
packageName = ref.getQualifiedName().getBaNamespace().getId();
}
NamedElement ne = null;
// Now check the type in each current package's sections.
for (PackageSection context : _contextsTab) {
ne = Aadl2Visitors.findElementInPropertySet(propertyNameId.getId(), packageName, context);
if (ne != null) {
propertyNameId.setOsateRef(ne);
ref.getPropertyNames().get(0).setOsateRef(ne);
if (packageName != null) {
ref.getQualifiedName().getBaNamespace().setOsateRef(ne.getNamespace());
ref.getQualifiedName().setOsateRef(ne.getNamespace());
}
if (ne instanceof Property) {
Property p = (Property) ne;
// First search within the default values.
if (p.getDefaultValue() != null) {
PropertyExpression pe = p.getDefaultValue();
propertyNameId.setOsateRef(pe);
ref.getPropertyNames().get(0).setOsateRef(pe);
}
return propertyNameResolver(ref.getPropertyNames());
} else if (ne instanceof PropertyType) {
if (ne instanceof EnumerationType) {
return propertyNameResolver(ref.getPropertyNames());
} else {
// It doesn't make any sense
// for the other types.
String msg = "reference to property type (other than enumeration" + " type) is not supported";
_errManager.error(ref.getPropertyNames().get(1).getPropertyName(), msg);
return false;
}
} else // Property constant case.
{
if (ref.getPropertyNames().size() > 1) {
// Property constants haven't any sub property.
String msg = "property names are not supported for property constant";
_errManager.error(ref.getPropertyNames().get(1).getPropertyName(), msg);
return false;
} else {
DeclarativePropertyName firstDpn = ref.getPropertyNames().get(0);
if (null != firstDpn.getField() || firstDpn.isSetIndexes()) {
// Property constants haven't any property field.
String msg = "property fields are not supported for property constant";
BehaviorElement bel = (null != firstDpn.getField()) ? firstDpn.getField() : firstDpn.getIndexes().get(0);
_errManager.error(bel, msg);
return false;
} else {
return true;
}
}
}
}
}
reportNameError(propertyNameId, propertyNameId.getId());
return false;
}
use of org.osate.ba.aadlba.BehaviorElement in project osate2 by osate.
the class QualifiedNamedElementImpl method setBaRef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setBaRef(BehaviorElement newBaRef) {
BehaviorElement oldBaRef = baRef;
baRef = newBaRef;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, DeclarativePackage.QUALIFIED_NAMED_ELEMENT__BA_REF, oldBaRef, baRef));
}
}
use of org.osate.ba.aadlba.BehaviorElement in project osate2 by osate.
the class DeclarativeTimeImpl method setBaRef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setBaRef(BehaviorElement newBaRef) {
BehaviorElement oldBaRef = baRef;
baRef = newBaRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeclarativePackage.DECLARATIVE_TIME__BA_REF, oldBaRef, baRef));
}
use of org.osate.ba.aadlba.BehaviorElement in project osate2 by osate.
the class ReferenceImpl method setBaRef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setBaRef(BehaviorElement newBaRef) {
BehaviorElement oldBaRef = baRef;
baRef = newBaRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeclarativePackage.REFERENCE__BA_REF, oldBaRef, baRef));
}
use of org.osate.ba.aadlba.BehaviorElement in project osate2 by osate.
the class IdentifierImpl method setBaRef.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void setBaRef(BehaviorElement newBaRef) {
BehaviorElement oldBaRef = baRef;
baRef = newBaRef;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, DeclarativePackage.IDENTIFIER__BA_REF, oldBaRef, baRef));
}
Aggregations