Search in sources :

Example 56 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class DeploymentProperties method getSchedulingProtocol.

public static Optional<List<SupportedSchedulingProtocols>> getSchedulingProtocol(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getSchedulingProtocol_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
            PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
            return SupportedSchedulingProtocols.valueOf(resolved1);
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 57 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class DeploymentProperties method getAllowedSubprogramCallBinding.

public static Optional<List<InstanceObject>> getAllowedSubprogramCallBinding(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getAllowedSubprogramCallBinding_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
            PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
            return ((InstanceReferenceValue) resolved1).getReferencedInstanceObject();
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) InstanceReferenceValue(org.osate.aadl2.instance.InstanceReferenceValue) Property(org.osate.aadl2.Property)

Example 58 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class DeploymentProperties method getActualSubprogramCallBinding.

public static Optional<List<InstanceObject>> getActualSubprogramCallBinding(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getActualSubprogramCallBinding_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
            PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
            return ((InstanceReferenceValue) resolved1).getReferencedInstanceObject();
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) InstanceReferenceValue(org.osate.aadl2.instance.InstanceReferenceValue) Property(org.osate.aadl2.Property)

Example 59 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class CommunicationProperties method getConnectionPattern.

public static Optional<List<List<SupportedConnectionPatterns>>> getConnectionPattern(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getConnectionPattern_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
            PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
            return ((ListValue) resolved1).getOwnedListElements().stream().map(element2 -> {
                PropertyExpression resolved2 = CodeGenUtil.resolveNamedValue(element2, lookupContext, mode);
                return SupportedConnectionPatterns.valueOf(resolved2);
            }).collect(Collectors.toList());
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : ListValue(org.osate.aadl2.ListValue) IntegerWithUnits(org.osate.pluginsupport.properties.IntegerWithUnits) IntegerLiteral(org.osate.aadl2.IntegerLiteral) EObject(org.eclipse.emf.ecore.EObject) Collectors(java.util.stream.Collectors) SupportedConnectionPatterns(org.osate.aadl2.contrib.aadlproject.SupportedConnectionPatterns) Aadl2GlobalScopeUtil(org.osate.aadl2.modelsupport.scoping.Aadl2GlobalScopeUtil) Mode(org.osate.aadl2.Mode) OptionalLong(java.util.OptionalLong) PropertyExpression(org.osate.aadl2.PropertyExpression) SupportedQueueProcessingProtocols(org.osate.aadl2.contrib.aadlproject.SupportedQueueProcessingProtocols) CodeGenUtil(org.osate.pluginsupport.properties.CodeGenUtil) List(java.util.List) IntegerRangeWithUnits(org.osate.pluginsupport.properties.IntegerRangeWithUnits) Property(org.osate.aadl2.Property) TimeUnits(org.osate.aadl2.contrib.aadlproject.TimeUnits) BooleanLiteral(org.osate.aadl2.BooleanLiteral) Optional(java.util.Optional) DataRateUnits(org.osate.aadl2.contrib.aadlproject.DataRateUnits) NamedElement(org.osate.aadl2.NamedElement) Aadl2Package(org.osate.aadl2.Aadl2Package) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 60 with ListValue

use of com.google.api.expr.v1alpha1.ListValue in project osate2 by osate.

the class CommunicationProperties method getInputTime.

public static Optional<List<IoTimeSpec>> getInputTime(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getInputTime_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ListValue) resolved).getOwnedListElements().stream().map(element1 -> {
            PropertyExpression resolved1 = CodeGenUtil.resolveNamedValue(element1, lookupContext, mode);
            return new IoTimeSpec(resolved1, lookupContext, mode);
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Aggregations

ListValue (org.osate.aadl2.ListValue)101 PropertyExpression (org.osate.aadl2.PropertyExpression)85 Property (org.osate.aadl2.Property)64 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)51 ClassifierValue (org.osate.aadl2.ClassifierValue)29 StringLiteral (org.osate.aadl2.StringLiteral)24 BasicPropertyAssociation (org.osate.aadl2.BasicPropertyAssociation)22 PropertyAssociation (org.osate.aadl2.PropertyAssociation)21 InstanceReferenceValue (org.osate.aadl2.instance.InstanceReferenceValue)21 IntegerLiteral (org.osate.aadl2.IntegerLiteral)19 ModalPropertyValue (org.osate.aadl2.ModalPropertyValue)19 RecordValue (org.osate.aadl2.RecordValue)19 ReferenceValue (org.osate.aadl2.ReferenceValue)16 NamedValue (org.osate.aadl2.NamedValue)15 Classifier (org.osate.aadl2.Classifier)14 RangeValue (org.osate.aadl2.RangeValue)13 ContainmentPathElement (org.osate.aadl2.ContainmentPathElement)12 ArrayList (java.util.ArrayList)11 BooleanLiteral (org.osate.aadl2.BooleanLiteral)11 PropertyConstant (org.osate.aadl2.PropertyConstant)11