Search in sources :

Example 11 with ClassifierValue

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

the class ModelingProperties method getImplementedAs.

public static Optional<Classifier> getImplementedAs(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getImplementedAs_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ClassifierValue) resolved).getClassifier());
    } 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 12 with ClassifierValue

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

the class ProgrammingProperties method getInitializeEntrypoint.

public static Optional<Classifier> getInitializeEntrypoint(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getInitializeEntrypoint_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ClassifierValue) resolved).getClassifier());
    } 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 13 with ClassifierValue

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

the class TimingProperties method getReferenceProcessor.

public static Optional<Classifier> getReferenceProcessor(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getReferenceProcessor_Property(lookupContext);
    try {
        PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
        PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
        return Optional.of(((ClassifierValue) resolved).getClassifier());
    } 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 14 with ClassifierValue

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

the class DeploymentProperties method getAllowedProcessorBindingClass.

public static Optional<List<Classifier>> getAllowedProcessorBindingClass(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getAllowedProcessorBindingClass_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 15 with ClassifierValue

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

the class DeploymentProperties method getAllowedMemoryBindingClass.

public static Optional<List<Classifier>> getAllowedMemoryBindingClass(NamedElement lookupContext, Optional<Mode> mode) {
    Property property = getAllowedMemoryBindingClass_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)

Aggregations

ClassifierValue (org.osate.aadl2.ClassifierValue)37 PropertyExpression (org.osate.aadl2.PropertyExpression)37 ListValue (org.osate.aadl2.ListValue)29 Property (org.osate.aadl2.Property)27 PropertyNotPresentException (org.osate.aadl2.properties.PropertyNotPresentException)21 Classifier (org.osate.aadl2.Classifier)16 IntegerLiteral (org.osate.aadl2.IntegerLiteral)15 StringLiteral (org.osate.aadl2.StringLiteral)13 RangeValue (org.osate.aadl2.RangeValue)12 RecordValue (org.osate.aadl2.RecordValue)12 NamedValue (org.osate.aadl2.NamedValue)11 BasicPropertyAssociation (org.osate.aadl2.BasicPropertyAssociation)10 BooleanLiteral (org.osate.aadl2.BooleanLiteral)10 ContainmentPathElement (org.osate.aadl2.ContainmentPathElement)10 PropertyConstant (org.osate.aadl2.PropertyConstant)10 RealLiteral (org.osate.aadl2.RealLiteral)10 ReferenceValue (org.osate.aadl2.ReferenceValue)10 BasicProperty (org.osate.aadl2.BasicProperty)9 ComponentClassifier (org.osate.aadl2.ComponentClassifier)9 List (java.util.List)8