use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class DataModel method getEnumerators.
public static Optional<List<String>> getEnumerators(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getEnumerators_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 ((StringLiteral) resolved1).getValue();
}).collect(Collectors.toList()));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class DataModel method getInitialValue.
public static Optional<List<String>> getInitialValue(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getInitialValue_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 ((StringLiteral) resolved1).getValue();
}).collect(Collectors.toList()));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class DataModel method getMeasurementUnit.
public static Optional<String> getMeasurementUnit(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getMeasurementUnit_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(((StringLiteral) resolved).getValue());
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class DataModel method getRepresentation.
public static Optional<List<String>> getRepresentation(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getRepresentation_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 ((StringLiteral) resolved1).getValue();
}).collect(Collectors.toList()));
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class Sei method getPlatform.
public static Optional<String> getPlatform(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getPlatform_Property(lookupContext);
try {
PropertyExpression value = CodeGenUtil.lookupProperty(property, lookupContext, mode);
PropertyExpression resolved = CodeGenUtil.resolveNamedValue(value, lookupContext, mode);
return Optional.of(((StringLiteral) resolved).getValue());
} catch (PropertyNotPresentException e) {
return Optional.empty();
}
}
Aggregations