Search in sources :

Example 1 with SetParser

use of alien4cloud.tosca.parser.impl.base.SetParser in project alien4cloud by alien4cloud.

the class SetMappingBuilder method buildMapping.

@Override
public MappingTarget buildMapping(MappingNode mappingNode, ParsingContextExecution context) {
    Map<String, String> map = ParserUtils.parseStringMap(mappingNode, context);
    SetParser parser;
    if (map.get(KEY) == null) {
        parser = baseParserFactory.getSetParser(baseParserFactory.getReferencedParser(map.get(TYPE)), "sequence of " + map.get(TYPE));
    } else {
        parser = baseParserFactory.getSetParser(baseParserFactory.getReferencedParser(map.get(TYPE)), "map of " + map.get(TYPE), map.get(KEY));
    }
    return new MappingTarget(map.get(SET), parser);
}
Also used : SetParser(alien4cloud.tosca.parser.impl.base.SetParser) MappingTarget(alien4cloud.tosca.parser.MappingTarget)

Aggregations

MappingTarget (alien4cloud.tosca.parser.MappingTarget)1 SetParser (alien4cloud.tosca.parser.impl.base.SetParser)1