use of org.osate.aadl2.PropertyType in project osate2 by osate.
the class PropertiesValidator method checkPropertyAssociation.
protected void checkPropertyAssociation(PropertyAssociation pa) {
// type check value against type
Property pdef = pa.getProperty();
checkPropertySetElementReferenceForPackageProperties(pdef, pa);
checkPropertySetElementReference(pdef, pa);
if (Aadl2Util.isNull(pdef)) {
return;
}
PropertyType pt = pdef.getPropertyType();
if (Aadl2Util.isNull(pt)) {
return;
}
EList<ModalPropertyValue> pvl = pa.getOwnedValues();
for (ModalPropertyValue modalPropertyValue : pvl) {
typeCheckPropertyValues(pt, modalPropertyValue.getOwnedValue(), modalPropertyValue.getOwnedValue(), pdef.getQualifiedName(), 0);
}
checkAssociationAppliesTo(pa);
checkInBinding(pa);
if (pa.getProperty() != null) {
if ("Byte_Count".equalsIgnoreCase(pa.getProperty().getName())) {
boolean offerQuickFix = true;
for (ModalPropertyValue modalPropertyValue : pvl) {
PropertyExpression pe = modalPropertyValue.getOwnedValue();
if (!(pe instanceof NumberValue)) {
offerQuickFix = false;
break;
}
}
if (offerQuickFix) {
warning("Byte_Count is deprecated. Please use Memory_Size.", pa, null, BYTE_COUNT_DEPRECATED);
} else {
warning(pa, "Byte_Count is deprecated. Please use Memory_Size.");
}
} else // } else
if ("Source_Code_Size".equalsIgnoreCase(pa.getProperty().getName())) {
warning("Source_Code_Size is deprecated. Please use Code_Size.", pa, null, SOURCE_CODE_SIZE_DEPRECATED);
} else if ("Source_Data_Size".equalsIgnoreCase(pa.getProperty().getName())) {
warning("Source_Data_Size is deprecated. Please use Data_Size.", pa, null, SOURCE_DATA_SIZE_DEPRECATED);
} else if ("Source_Heap_Size".equalsIgnoreCase(pa.getProperty().getName())) {
warning("Source_Heap_Size is deprecated. Please use Heap_Size.", pa, null, SOURCE_HEAP_SIZE_DEPRECATED);
} else if ("Source_Stack_Size".equalsIgnoreCase(pa.getProperty().getName())) {
warning("Source_Stack_Size is deprecated. Please use Stack_Size.", pa, null, SOURCE_STACK_SIZE_DEPRECATED);
} else if ("Data_Volume".equalsIgnoreCase(pa.getProperty().getName())) {
warning("Data_Volume is deprecated. Please use Data_Rate.", pa, null, DATA_VOLUME_DEPRECATED);
}
}
checkConstantProperty(pa);
}
use of org.osate.aadl2.PropertyType in project osate2 by osate.
the class AadlStructureBridge method canBeLandmark.
@Override
public boolean canBeLandmark(final String handle) {
// Must be a component classifier, feature, subcomponent, etc, or a property declaration in a property set.
final Element aadlElement = (Element) getObjectForHandle(handle);
final boolean isLandmark = aadlElement instanceof PropertySet || aadlElement instanceof AadlPackage || aadlElement instanceof PackageSection || aadlElement instanceof Classifier || aadlElement instanceof ClassifierFeature || aadlElement instanceof PropertyConstant || aadlElement instanceof PropertyType || aadlElement instanceof Property;
return isLandmark;
}
use of org.osate.aadl2.PropertyType in project osate2 by osate.
the class PropertiesLinkingService method findUnitLiteral.
public static UnitLiteral findUnitLiteral(Property property, String name) {
PropertyType propertyType = property.getPropertyType();
UnitsType unitsType = null;
if (propertyType instanceof NumberType) {
unitsType = ((NumberType) propertyType).getUnitsType();
} else if (propertyType instanceof RangeType) {
unitsType = ((RangeType) propertyType).getNumberType().getUnitsType();
}
if (unitsType != null) {
return unitsType.findLiteral(name);
}
return null;
}
use of org.osate.aadl2.PropertyType in project osate2 by osate.
the class PropertiesLinkingService method findPropertyType.
/**
* find property type based on property name.
* The name is qualified with the property set name, or if unqualified is assumed to be a predeclared property type
* The context object can be any model object, typically the object that is the context of the reference such as a property definition
* @param context Element an AADL model element
* @param name property type name possibly qualified with the property set name
* @return PropertyType the property type or null
*/
public PropertyType findPropertyType(EObject context, String name) {
// look for property type in property set
EReference reference = Aadl2Package.eINSTANCE.getBasicProperty_PropertyType();
EObject e = findPropertySetElement(context, reference, name);
if (e != null && e instanceof PropertyType) {
return (PropertyType) e;
}
return null;
}
use of org.osate.aadl2.PropertyType in project osate2 by osate.
the class PropertyConstantImpl method setReferencedPropertyType.
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public void setReferencedPropertyType(PropertyType newReferencedPropertyType) {
PropertyType oldReferencedPropertyType = referencedPropertyType;
referencedPropertyType = newReferencedPropertyType;
if (eNotificationRequired()) {
eNotify(new ENotificationImpl(this, Notification.SET, Aadl2Package.PROPERTY_CONSTANT__REFERENCED_PROPERTY_TYPE, oldReferencedPropertyType, referencedPropertyType));
}
}
Aggregations