Search in sources :

Example 16 with PropertyExpression

use of org.osate.aadl2.PropertyExpression in project osate2 by osate.

the class DataModel method getRealRange.

public static Optional<RealRange> getRealRange(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getRealRange_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(new RealRange(resolved, lookupContext, mode));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : RealRange(org.osate.pluginsupport.properties.RealRange) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 17 with PropertyExpression

use of org.osate.aadl2.PropertyExpression in project osate2 by osate.

the class DataModel method getDataScale.

public static OptionalLong getDataScale(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getDataScale_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return OptionalLong.of(((IntegerLiteral) resolved).getValue());
    } catch (PropertyNotPresentException e) {
        return OptionalLong.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 18 with PropertyExpression

use of org.osate.aadl2.PropertyExpression in project osate2 by osate.

the class DataModel method getIeee754Precision.

public static Optional<Ieee754Precision> getIeee754Precision(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getIeee754Precision_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(Ieee754Precision.valueOf(resolved));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 19 with PropertyExpression

use of org.osate.aadl2.PropertyExpression in project osate2 by osate.

the class DataModel method getDataRepresentation.

public static Optional<DataRepresentation> getDataRepresentation(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getDataRepresentation_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(DataRepresentation.valueOf(resolved));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 20 with PropertyExpression

use of org.osate.aadl2.PropertyExpression in project osate2 by osate.

the class Arinc429 method getWordid.

public static OptionalLong getWordid(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getWordid_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return OptionalLong.of(((IntegerLiteral) resolved).getValue());
    } catch (PropertyNotPresentException e) {
        return OptionalLong.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Aggregations

PropertyExpression (org.osate.aadl2.PropertyExpression)405 Property (org.osate.aadl2.Property)300 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)246 ListValue (org.osate.aadl2.ListValue)89 BasicProperty (org.osate.aadl2.BasicProperty)51 PropertyAssociation (org.osate.aadl2.PropertyAssociation)41 TimeUnits (org.osate.aadl2.contrib.aadlproject.TimeUnits)40 PropertyLookupException (org.osate.aadl2.properties.PropertyLookupException)36 BasicPropertyAssociation (org.osate.aadl2.BasicPropertyAssociation)34 IntegerLiteral (org.osate.aadl2.IntegerLiteral)33 InstanceReferenceValue (org.osate.aadl2.instance.InstanceReferenceValue)32 ModalPropertyValue (org.osate.aadl2.ModalPropertyValue)31 ArrayList (java.util.ArrayList)29 EnumerationLiteral (org.osate.aadl2.EnumerationLiteral)28 NamedElement (org.osate.aadl2.NamedElement)27 NamedValue (org.osate.aadl2.NamedValue)27 PropertyConstant (org.osate.aadl2.PropertyConstant)27 ClassifierValue (org.osate.aadl2.ClassifierValue)26 StringLiteral (org.osate.aadl2.StringLiteral)26 ENotificationImpl (org.eclipse.emf.ecore.impl.ENotificationImpl)23