use of org.osate.aadl2.PropertyExpression in project osate2 by osate.
the class DataModel method getRealRange.
public static Optional<RealRange> getRealRange(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getRealRange_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(new RealRange(resolved, lookupContext, mode));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.PropertyExpression in project osate2 by osate.
the class DataModel method getDataScale.
public static OptionalLong getDataScale(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getDataScale_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.PropertyExpression in project osate2 by osate.
the class DataModel method getIeee754Precision.
public static Optional<Ieee754Precision> getIeee754Precision(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getIeee754Precision_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(Ieee754Precision.valueOf(resolved));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.PropertyExpression in project osate2 by osate.
the class DataModel method getDataRepresentation.
public static Optional<DataRepresentation> getDataRepresentation(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getDataRepresentation_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(DataRepresentation.valueOf(resolved));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.PropertyExpression in project osate2 by osate.
the class Arinc429 method getWordid.
public static OptionalLong getWordid(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getWordid_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();
}
}
Aggregations