use of com.fasterxml.jackson.core.TreeNode in project che by eclipse.
the class CommandDeserializer method toCommand.
private List<String> toCommand(ArrayNode arrayCommandNode, DeserializationContext ctxt) throws JsonMappingException {
List<String> commands = new ArrayList<>();
for (TreeNode treeNode : arrayCommandNode) {
if (treeNode instanceof TextNode) {
TextNode textNode = (TextNode) treeNode;
commands.add(textNode.asText());
} else {
throw ctxt.mappingException("Array 'command' contains not string element.");
}
}
return commands;
}
Aggregations