Package com.github.dandelion.datatables.core.util

Examples of com.github.dandelion.datatables.core.util.JsonIndentingWriter


    // Extension custom configuration generator
    if (extension.getConfigGenerator() != null) {
      logger.debug("Custom configuration generator used: {}", extension.getConfigGenerator().getClass()
          .getSimpleName());

      Writer writer = new JsonIndentingWriter();

      Map<String, Object> conf = extension.getConfigGenerator().generateConfig(table);

      // Allways pretty prints the JSON
      try {
        JSONValue.writeJSONString(conf, writer);
      } catch (IOException e) {
        throw new ExtensionLoadingException("Unable to convert the configuration into JSON", e);
      }

      mainJsFile.appendToDataTablesExtraConf(writer.toString());
    }
  }
View Full Code Here


     * Main configuration generation
     */
    logger.debug("Transforming configuration to JSON...");
    // Allways pretty prints the JSON
    try {
      Writer writer = new JsonIndentingWriter();
      JSONValue.writeJSONString(mainConf, writer);
      mainJsFile.appendToDataTablesConf(writer.toString());
    } catch (IOException e) {
      throw new WebResourceGenerationException("Unable to generate the JSON configuration", e);
    }

    return mainJsFile;
View Full Code Here

TOP

Related Classes of com.github.dandelion.datatables.core.util.JsonIndentingWriter

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.