agave-metadata/metadata-core/src/main/java/org/iplantc/service/metadata/search/JsonHandler.java
/**
     * Recursively parse a JsonNode to handle nested objects to a {@link Document}
     *
     * @param jsonNode {@link JsonNode} to parse
     * @return {@link Document} matching the jsonNode
     */
Recursively parse a JsonNode to handle nested objects to a  Document
@param jsonNode  JsonNode to parse
@return  Document matching the jsonNode
Recursively parse a JsonNode to handle nested objects to a Document @param jsonNode JsonNode to parse @return Document matching the jsonNode
protected Document parseNestedJsonNodeToDocument(JsonNode jsonNode) {
        Document doc = new Document();
        for (Iterator<String> it = jsonNode.fieldNames(); it.hasNext(); ) {
            String key = it.next();
            JsonNode node = jsonNode.get(key);
            if (node.isObject()) {
                doc.append(key, parseNestedJsonNodeToDocument(node));
            } else if (node.isBoolean()) {
                doc.append(key, String.valueOf(node.asBoolean()));
            } else {
                doc.append(key, String.valueOf(node.asText()));
            }
        }
        return doc;
    }
protected Document parseNestedJsonNodeToDocument ( JsonNode jsonNode ) { Document doc = new Document ( ) ; for ( Iterator < String > it = jsonNode . fieldNames ( ) ; it . hasNext ( ) ; ) { String key = it . next ( ) ; JsonNode node = jsonNode . get ( key ) ; if ( node . isObject ( ) ) { doc . append ( key , parseNestedJsonNodeToDocument ( node ) ) ; } else if ( node . isBoolean ( ) ) { doc . append ( key , String . valueOf ( node . asBoolean ( ) ) ) ; } else { doc . append ( key , String . valueOf ( node . asText ( ) ) ) ; } } return doc ; }
Recursively parse a JsonNode to handle nested objects to a {@link Document}
 @param jsonNode {@link JsonNode} to parse
 @return {@link Document} matching the jsonNode
Recursively parse a JsonNode to handle nested objects to a { @link Document } @param jsonNode { @link JsonNode } to parse @return { @link Document } matching the jsonNode