Package org.codehaus.jackson

Examples of org.codehaus.jackson.JsonGenerator.writeFieldName()


        if (retValue != null) {
          writer.append(JacksonUtil.toJson(retValue));
        } else {
          JsonGenerator g = JacksonUtil.getMapper().getJsonFactory().createJsonGenerator(writer);
          g.writeStartObject();
          g.writeFieldName("__cmds");
          g.writeStartArray();
          List<Object> functions = new ArrayList<Object>(context.getFunctions());
          for (Object function : functions) {
            g.writeObject(function);
          }
View Full Code Here


  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) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
View Full Code Here

    {
        JsonFactory factory = new JsonFactory();
        StringWriter writer = new StringWriter();
        JsonGenerator generator = factory.createJsonGenerator(writer);
        generator.writeStartObject();
        generator.writeFieldName("bool");
        generator.writeBoolean(true);
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
View Full Code Here

        StringWriter writer = new StringWriter();
        JsonGenerator generator = factory.createJsonGenerator(writer);
        generator.writeStartObject();
        generator.writeFieldName("bool");
        generator.writeBoolean(true);
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
        generator.writeFieldName("gg");
        generator.writeStartObject();
View Full Code Here

        generator.writeStartObject();
        generator.writeFieldName("bool");
        generator.writeBoolean(true);
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
        generator.writeFieldName("gg");
        generator.writeStartObject();
        generator.writeFieldName("firstName");
        generator.writeString("john");
View Full Code Here

        generator.writeBoolean(true);
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
        generator.writeFieldName("gg");
        generator.writeStartObject();
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeEndObject();
       
View Full Code Here

        generator.writeString("john");
        generator.writeFieldName("age");
        generator.writeNumber(1);
        generator.writeFieldName("gg");
        generator.writeStartObject();
        generator.writeFieldName("firstName");
        generator.writeString("john");
        generator.writeEndObject();
       
        generator.writeEndObject();
        generator.close();
View Full Code Here

  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) {
      for (Map.Entry<Object,Object> item: config.getProps().entrySet()) {
        dumpGenerator.writeStartObject();
View Full Code Here

                    JsonGenerator g = f.createJsonGenerator(assumptionFile, JsonEncoding.UTF8);
                    g.useDefaultPrettyPrinter();
                    g.writeStartObject();
                    for (Map.Entry<String, Map<String, Map<String, String>>> ksEntry : assumptions.entrySet())
                    {
                        g.writeFieldName(ksEntry.getKey());
                        g.writeStartArray();
                        for (Map.Entry<String, Map<String, String>> cfEntry : ksEntry.getValue().entrySet())
                        {
                            g.writeStartObject();
                            g.writeFieldName(cfEntry.getKey());
View Full Code Here

                        g.writeFieldName(ksEntry.getKey());
                        g.writeStartArray();
                        for (Map.Entry<String, Map<String, String>> cfEntry : ksEntry.getValue().entrySet())
                        {
                            g.writeStartObject();
                            g.writeFieldName(cfEntry.getKey());
                            g.writeStartArray();
                            for (Map.Entry<String, String> asEntry : cfEntry.getValue().entrySet())
                            {
                                g.writeStartObject();
                                g.writeStringField(asEntry.getKey(), asEntry.getValue());
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.