use of org.alien4cloud.tosca.model.definitions.UpperBoundedDefinition in project alien4cloud by alien4cloud.
the class OccurrencesParser method parse.
@Override
public List<String> parse(Node node, ParsingContextExecution context) {
Object parent = context.getParent();
List<String> result = (List<String>) listParser.parse(node, context);
if (result.size() != 2) {
context.getParsingErrors().add(new ParsingError(ErrorCode.SYNTAX_ERROR, null, node.getStartMark(), null, node.getEndMark(), null));
return result;
}
if (parent instanceof LowerBoundedDefinition) {
((LowerBoundedDefinition) parent).setLowerBound(Integer.parseInt(result.get(0)));
}
if (parent instanceof UpperBoundedDefinition) {
((UpperBoundedDefinition) parent).setUpperBound(Integer.parseInt(result.get(1)));
}
return result;
}
Aggregations