Package jsontemplate

Examples of jsontemplate.TemplateCompileOptions


      System.err.println(s);
      JSONObject obj = new JSONObject(s);
      String template = (String) obj.get("template");
      JSONObject optionsDict = (JSONObject) obj.get("options");
      Object dictionary = obj.get("dictionary");
      TemplateCompileOptions options = new TemplateCompileOptions();
      if (optionsDict.has("meta")) {
        options.setMeta(optionsDict.getString("meta"));
      }
      if (optionsDict.has("default_formatter")) {
        Object defaultFormatter = optionsDict.get("default_formatter");
        if (JSONObject.NULL.equals(defaultFormatter)) {
          options.setDefaultFormatter(null);
        } else {
          options.setDefaultFormatter(defaultFormatter.toString());
        }
      }
      if (optionsDict.has("format_char")) {
        char formatChar = optionsDict.getString("format_char").charAt(0);
        options.setFormatChar(formatChar);
      }
      System.out.print(new Template(template, null, options)
          .expand(convertObject(dictionary)));
    } catch (Exception e) {
      System.err.println("EXCEPTION: " + e.getClass().getSimpleName());
View Full Code Here

TOP

Related Classes of jsontemplate.TemplateCompileOptions

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.