use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class TimingProperties method getClockPeriod.
public static Optional<IntegerWithUnits<TimeUnits>> getClockPeriod(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getClockPeriod_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();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class MemoryProperties method getHeapSize.
public static Optional<IntegerWithUnits<SizeUnits>> getHeapSize(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getHeapSize_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(new IntegerWithUnits<>(resolved, SizeUnits.class));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class MemoryProperties method getAccessTime.
public static Optional<AccessTime> getAccessTime(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getAccessTime_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(new AccessTime(resolved, lookupContext, mode));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class MemoryProperties method getWordSpace.
public static OptionalLong getWordSpace(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getWordSpace_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return OptionalLong.of(((IntegerLiteral) resolved).getValue());
} catch (PropertyNotPresentException e) {
return OptionalLong.empty();
}
}
use of org.osate.aadl2.properties.PropertyNotPresentException in project osate2 by osate.
the class MemoryProperties method getAccessRight.
public static Optional<AccessRights> getAccessRight(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getAccessRight_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(AccessRights.valueOf(resolved));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
Aggregations