Search in sources :

Example 1 with ModelingProperties

use of org.osate.aadl2.contrib.modeling.ModelingProperties in project osate2 by osate.

the class GetProperties method getClassifierMatchingRuleProperty.

public static String getClassifierMatchingRuleProperty(NamedElement ne) {
    Property classifierMatchingRuleProperty = GetProperties.lookupPropertyDefinition(ne, ModelingProperties._NAME, ModelingProperties.CLASSIFIER_MATCHING_RULE);
    EnumerationLiteral classifierMatchingRuleValue;
    try {
        classifierMatchingRuleValue = PropertyUtils.getEnumLiteral(ne, classifierMatchingRuleProperty);
    } catch (PropertyNotPresentException e) {
        return ModelingProperties.CLASSIFIER_MATCH;
    }
    return classifierMatchingRuleValue.getName();
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) BasicProperty(org.osate.aadl2.BasicProperty) Property(org.osate.aadl2.Property) EnumerationLiteral(org.osate.aadl2.EnumerationLiteral)

Example 2 with ModelingProperties

use of org.osate.aadl2.contrib.modeling.ModelingProperties in project osate2 by osate.

the class GetProperties method getClassifierSubstitutionRuleProperty.

public static String getClassifierSubstitutionRuleProperty(NamedElement ne) {
    Property classifierMatchingRuleProperty = GetProperties.lookupPropertyDefinition(ne, ModelingProperties._NAME, ModelingProperties.CLASSIFIER_SUBSTITUTION_RULE);
    EnumerationLiteral classifierMatchingRuleValue;
    try {
        classifierMatchingRuleValue = PropertyUtils.getEnumLiteral(ne, classifierMatchingRuleProperty);
    } catch (PropertyNotPresentException e) {
        return ModelingProperties.CLASSIFIER_MATCH;
    }
    return classifierMatchingRuleValue.getName();
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) BasicProperty(org.osate.aadl2.BasicProperty) Property(org.osate.aadl2.Property) EnumerationLiteral(org.osate.aadl2.EnumerationLiteral)

Aggregations

BasicProperty (org.osate.aadl2.BasicProperty)2 EnumerationLiteral (org.osate.aadl2.EnumerationLiteral)2 Property (org.osate.aadl2.Property)2 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)2