Search in sources :

Example 6 with TreeNode

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;
}
Also used : TreeNode(com.fasterxml.jackson.core.TreeNode) ArrayList(java.util.ArrayList) TextNode(com.fasterxml.jackson.databind.node.TextNode)

Aggregations

TreeNode (com.fasterxml.jackson.core.TreeNode)6 TextNode (com.fasterxml.jackson.databind.node.TextNode)3 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 ArrayList (java.util.ArrayList)2 HyperLogLogPlus (com.clearspring.analytics.stream.cardinality.HyperLogLogPlus)1 JsonParser (com.fasterxml.jackson.core.JsonParser)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 RealmList (io.realm.RealmList)1 NYTimesMultimedium (io.realm.examples.newsreader.model.entity.NYTimesMultimedium)1 IOException (java.io.IOException)1 Entry (java.util.Map.Entry)1 RoaringBitmap (org.roaringbitmap.RoaringBitmap)1