use of org.osate.aadl2.PropertyOwner in project osate2 by osate.
the class ComponentInstanceImpl method acceptsProperty.
public boolean acceptsProperty(Property property) {
ComponentClassifier cc = getComponentClassifier();
Subcomponent sub = getSubcomponent();
if (getCategory().equals(ComponentCategory.ABSTRACT)) {
return true;
}
for (PropertyOwner propOwner : property.getAppliesTos()) {
if (propOwner instanceof MetaclassReference) {
MetaclassReference metaRef = (MetaclassReference) propOwner;
if (metaRef.getMetaclassNames().get(0).equals("all")) {
return true;
} else {
EClass appliesTo = metaRef.getMetaclass();
if (appliesTo == null) {
return false;
}
if (cc != null && appliesTo.isSuperTypeOf(cc.eClass()) || sub != null && appliesTo.isSuperTypeOf(sub.eClass())) {
return true;
}
}
}
}
return (cc == null) ? false : cc.checkAppliesToClassifier(property);
}
use of org.osate.aadl2.PropertyOwner in project osate2 by osate.
the class ConnectionReferenceImpl method acceptsProperty.
/*
* (non-Javadoc)
*
* @see org.osate.aadl2.instance.impl.InstanceObjectImpl#acceptsProperty(org.osate.aadl2.Property)
*/
public boolean acceptsProperty(Property property) {
final boolean result;
for (final PropertyOwner propOwner : property.getAppliesTos()) {
if (propOwner instanceof MetaclassReference) {
if ((((MetaclassReference) propOwner).getMetaclassNames().size() > 0) && ((MetaclassReference) propOwner).getMetaclassNames().get(0).equals("all")) {
return true;
}
}
}
// OsateDebug.osateDebug("[ConnectionReferenceImpl] acceptsProperty" + property);
// OsateDebug.osateDebug("[ConnectionReferenceImpl] getConnection()=" + getConnection());
result = getConnection().acceptsProperty(property);
// OsateDebug.osateDebug("[ConnectionReferenceImpl] result=" + result);
return result;
}
Aggregations