use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class ProgrammingProperties method getRecoverEntrypointSourceText.
public static Optional<String> getRecoverEntrypointSourceText(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getRecoverEntrypointSourceText_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 ProgrammingProperties method getComputeEntrypointSourceText.
public static Optional<String> getComputeEntrypointSourceText(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getComputeEntrypointSourceText_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 ProgrammingProperties method getActivateEntrypointSourceText.
public static Optional<String> getActivateEntrypointSourceText(NamedElement lookupContext, Optional<Mode> mode) {
Property property = getActivateEntrypointSourceText_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 GetProperties method getDataEnumerators.
public static List<String> getDataEnumerators(final NamedElement ne) {
List<String> res;
res = new ArrayList<String>();
try {
Property st = lookupPropertyDefinition(ne, DataModel._NAME, DataModel.Enumerators);
List<? extends PropertyExpression> propertyValues = ne.getPropertyValueList(st);
for (PropertyExpression propertyExpression : propertyValues) {
// System.out.println("pe=" + propertyExpression);
StringLiteral sl = (StringLiteral) propertyExpression;
res.add(sl.getValue());
}
return res;
} catch (PropertyLookupException e) {
return null;
}
}
use of org.osate.aadl2.StringLiteral in project osate2 by osate.
the class GetProperties method getPlatform.
public static String getPlatform(final NamedElement ne) {
try {
Property sn = lookupPropertyDefinition(ne, SEI._NAME, SEI.PLATFORM);
PropertyAcc pacc = ne.getPropertyValue(sn);
if (pacc.getAssociations().size() > 0) {
ModalPropertyValue mdv = pacc.getAssociations().get(0).getOwnedValues().get(0);
PropertyExpression pe = mdv.getOwnedValue();
StringLiteral sl = (StringLiteral) pe;
return sl.getValue();
}
return null;
} catch (PropertyLookupException e) {
return null;
}
}
Aggregations