Examples of createJsonGenerator()


Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

        File tmpFile = new File(manifestFile.getPath().replace(EXTENSION, "-tmp.json"));

        JsonFactory f = new JsonFactory();
        try
        {
            JsonGenerator g = f.createJsonGenerator(tmpFile, JsonEncoding.UTF8);
            g.useDefaultPrettyPrinter();
            g.writeStartObject();
            g.writeArrayFieldStart("generations");
            for (int level = 0; level < generations.length; level++)
            {
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

    public static String toString(JsonParser parser) {
        try {
            JsonFactory jsonFactory = getJsonFactory();
            StringWriter sw = new StringWriter();
            JsonGenerator generator = jsonFactory.createJsonGenerator(sw);
            JsonNode node = parser.readValueAs(JsonNode.class);
            generator.writeTree(node);
            return sw.toString();
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

    }

    public static void write(JsonNode node, OutputStream out) {
        try {
            JsonFactory jsonFactory = getJsonFactory();
            JsonGenerator generator = jsonFactory.createJsonGenerator(out, JsonEncoding.UTF8);
            generator.writeTree(node);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
    }
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

    }

    public static void write(JsonParser parser, OutputStream out) {
        try {
            JsonFactory jsonFactory = getJsonFactory();
            JsonGenerator generator = jsonFactory.createJsonGenerator(out, JsonEncoding.UTF8);
            JsonNode node = parser.readValueAs(JsonNode.class);
            generator.writeTree(node);
        } catch (IOException e) {
            throw new IllegalArgumentException(e);
        }
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

    }

    StringWriter sw = new StringWriter();
    try {
      JsonFactory f = new JsonFactory();
      JsonGenerator g = f.createJsonGenerator(sw);

      g.writeStartObject();

      // write id field
      g.writeRaw("\n  ");
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

    case JSON:
    {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      JsonFactory f = new JsonFactory();
      try {
        JsonGenerator g = f.createJsonGenerator(baos, JsonEncoding.UTF8);
        g.writeStartObject();
        int version = getVersion();
        if (version == DbusEventFactory.DBUS_EVENT_V1)
        {
          writeJSON_V1(g,encoding);
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

   * @throws IOException
   */
  public static void dumpConfiguration(Configuration config,
      Writer out) throws IOException {
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

    if (onlyTheseKeys != null && onlyTheseKeys.isEmpty())
      return;

    try {
      JsonFactory f = new JsonFactory();
      JsonGenerator g = f.createJsonGenerator(bundleFile, JsonEncoding.UTF8);
      g.useDefaultPrettyPrinter();
      g.writeStartObject();
      Set<String> orderedKeys = new TreeSet<String>(i18nValues.keySet());
      for (String key : orderedKeys) {
        String value = i18nValues.get(key);
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

        JsonFactory f = new JsonFactory();
        try
        {
            FileOutputStream fos = new FileOutputStream(tmpFile);
            JsonGenerator g = f.createJsonGenerator(fos, JsonEncoding.UTF8);
            g.useDefaultPrettyPrinter();
            g.writeStartObject();
            g.writeArrayFieldStart("generations");
            for (int level = 0; level < generations.length; level++)
            {
View Full Code Here

Examples of org.codehaus.jackson.JsonFactory.createJsonGenerator()

   * @throws IOException
   */
  public static void dumpConfiguration(Configuration config,
      Writer out) throws IOException {
    JsonFactory dumpFactory = new JsonFactory();
    JsonGenerator dumpGenerator = dumpFactory.createJsonGenerator(out);
    dumpGenerator.writeStartObject();
    dumpGenerator.writeFieldName("properties");
    dumpGenerator.writeStartArray();
    dumpGenerator.flush();
    synchronized (config) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.