use of alien4cloud.tosca.parser.MappingTarget 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);
}
use of alien4cloud.tosca.parser.MappingTarget in project alien4cloud by alien4cloud.
the class ToscaMetaMapping method initMapping.
@Override
public void initMapping() {
instance.getYamlToObjectMapping().put("TOSCA-Meta-File-Version", new MappingTarget("", getScalarParser()));
instance.getYamlToObjectMapping().put("CSAR-Version", new MappingTarget("version", getScalarParser()));
instance.getYamlToObjectMapping().put("Created-By", new MappingTarget("createdBy", getScalarParser()));
instance.getYamlToObjectMapping().put("Entry-Definitions", new MappingTarget("entryDefinitions", getScalarParser()));
instance.getYamlToObjectMapping().put("Name", new MappingTarget("name", getScalarParser()));
instance.getYamlToObjectMapping().put("Content-Type", new MappingTarget("", getScalarParser()));
}
use of alien4cloud.tosca.parser.MappingTarget in project alien4cloud by alien4cloud.
the class ListMappingBuilder method buildMapping.
@Override
public MappingTarget buildMapping(MappingNode mappingNode, ParsingContextExecution context) {
Map<String, String> map = ParserUtils.parseStringMap(mappingNode, context);
ListParser parser;
if (map.get(KEY) == null) {
parser = baseParserFactory.getListParser(baseParserFactory.getReferencedParser(map.get(TYPE)), "sequence of " + map.get(TYPE));
} else {
parser = baseParserFactory.getListParser(baseParserFactory.getReferencedParser(map.get(TYPE)), "sequence of " + map.get(TYPE), map.get(KEY));
}
return new MappingTarget(map.get(LIST), parser);
}
Aggregations