use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class ThreadProperties method getDispatchAble.
public static Optional<Boolean> getDispatchAble(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getDispatchAble_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(((BooleanLiteral) resolved).getValue());
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class TimingProperties method getDeactivateExecutionTime.
public static Optional<IntegerRangeWithUnits<TimeUnits>> getDeactivateExecutionTime(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getDeactivateExecutionTime_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(new IntegerRangeWithUnits<>(resolved, TimeUnits.class, lookupContext, mode));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class TimingProperties method getFinalizeExecutionTime.
public static Optional<IntegerRangeWithUnits<TimeUnits>> getFinalizeExecutionTime(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getFinalizeExecutionTime_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(new IntegerRangeWithUnits<>(resolved, TimeUnits.class, lookupContext, mode));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException 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.properties.PropertyNotPresentException in project osate2 by osate.
the class TimingProperties method getFirstDispatchTime.
public static Optional<IntegerWithUnits<TimeUnits>> getFirstDispatchTime(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getFirstDispatchTime_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(new IntegerWithUnits<>(resolved, TimeUnits.class));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
Aggregations