Search in sources :

Example 36 with ListValue

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

the class DeploymentProperties method getAllowedConnectionBindingClass.

public static Optional<List<Classifier>> getAllowedConnectionBindingClass(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getAllowedConnectionBindingClass_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 ((ClassifierValue) resolved1).getClassifier();
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : ClassifierValue(org.osate.aadl2.ClassifierValue) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 37 with ListValue

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

the class DeploymentProperties method getAllowedPhysicalAccessClass.

public static Optional<List<Classifier>> getAllowedPhysicalAccessClass(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getAllowedPhysicalAccessClass_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 ((ClassifierValue) resolved1).getClassifier();
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : ClassifierValue(org.osate.aadl2.ClassifierValue) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 38 with ListValue

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

the class DeploymentProperties method getAllowedSubprogramCall.

public static Optional<List<InstanceObject>> getAllowedSubprogramCall(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getAllowedSubprogramCall_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 39 with ListValue

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

the class DeploymentProperties method getProvidedVirtualBusClass.

public static Optional<List<Classifier>> getProvidedVirtualBusClass(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getProvidedVirtualBusClass_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 ((ClassifierValue) resolved1).getClassifier();
        }).collect(Collectors.toList()));
    } catch (PropertyNotPresentException e) {
        return Optional.empty();
    }
}
Also used : ClassifierValue(org.osate.aadl2.ClassifierValue) PropertyNotPresentException(org.osate.aadl2.properties.PropertyNotPresentException) ListValue(org.osate.aadl2.ListValue) PropertyExpression(org.osate.aadl2.PropertyExpression) Property(org.osate.aadl2.Property)

Example 40 with ListValue

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

the class ThreadProperties method getDispatchTrigger.

public static Optional<List<InstanceObject>> getDispatchTrigger(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getDispatchTrigger_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)

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