Package com.github.mustachejava.util

Examples of com.github.mustachejava.util.NodeValue


  }

  private void writeNode(final JsonGenerator jg, Node invert) throws IOException {
    jg.writeStartObject();
    for (final Map.Entry<String, NodeValue> entry : invert.entrySet()) {
      NodeValue nodeValue = entry.getValue();
      if (nodeValue.isList() && nodeValue.list().size() > 0) {
        jg.writeFieldName(entry.getKey());
        List<Node> list = nodeValue.list();
        boolean array = list.size() > 1;
        if (array) jg.writeStartArray();
        for (Node node : list) {
          writeNode(jg, node);
        }
        if (array) jg.writeEndArray();
      } else {
        String value = nodeValue.value();
        if (value != null) {
          jg.writeFieldName(entry.getKey());
          try {
            double v = Double.parseDouble(value);
            jg.writeNumber(v);
View Full Code Here

TOP

Related Classes of com.github.mustachejava.util.NodeValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.