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();
}
}
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();
}
}
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();
}
}
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();
}
}
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();
}
}
Aggregations