Package org.codehaus.jackson

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


    else {
      parser = QueueManager.getQueueConfigurationParser(null, false);
    }
    dumpGenerator.writeStartObject();
    dumpGenerator.writeBooleanField("acls_enabled", parser.isAclsEnabled());
    dumpGenerator.writeFieldName("queues");
    dumpGenerator.writeStartArray();
    dumpConfiguration(dumpGenerator,parser.getRoot().getChildren());
    dumpGenerator.writeEndArray();
    dumpGenerator.writeEndObject();
    dumpGenerator.flush();
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

  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

        if (message.getExpression() == null) message.setExpression(new ConditionExpression());

        if (message.getExpression() != null) {

            generator.writeFieldName(ExpressionEditorMessageTokens.OPERATOR_TOKEN);
            if (message.getExpression().getOperator() != null) {
                generator.writeString(message.getExpression().getOperator());
            } else {
                generator.writeNull();
            }
View Full Code Here

            generator.writeArrayFieldStart(ExpressionEditorMessageTokens.CONDITIONS_TOKEN);
            if (message.getExpression().getConditions().size() > 0) {
                for (Condition condition : message.getExpression().getConditions()) {
                    generator.writeStartObject();
                    generator.writeFieldName(ExpressionEditorMessageTokens.CONDITION_TOKEN);
                    generator.writeString(condition.getFunction());
                    if (condition.getParameters().size() > 0) {
                        generator.writeArrayFieldStart(ExpressionEditorMessageTokens.PARAMETERS_TOKEN);
                        for (String param : condition.getParameters()) {
                            generator.writeString(param);
View Full Code Here

                }
            }
            generator.writeEndArray();
        }

        generator.writeFieldName(ExpressionEditorMessageTokens.SCRIPT_TOKEN);
        if (message.getScript() != null) {
            generator.writeString(message.getScript());
        } else {
            generator.writeNull();
        }
View Full Code Here

            generator.writeString(message.getScript());
        } else {
            generator.writeNull();
        }

        generator.writeFieldName(ExpressionEditorMessageTokens.ERROR_CODE_TOKEN);
        if (message.getErrorCode() != null) {
            generator.writeString(message.getErrorCode());
        } else {
            generator.writeNull();
        }
View Full Code Here

            generator.writeString(message.getErrorCode());
        } else {
            generator.writeNull();
        }

        generator.writeFieldName(ExpressionEditorMessageTokens.ERROR_MESSAGE_TOKEN);
        if (message.getErrorMessage() != null) {
            generator.writeString(message.getErrorMessage());
        } else {
            generator.writeNull();
        }
View Full Code Here

      JsonGenerator json = new JsonFactory().createJsonGenerator(out);
      json.setCodec(new ObjectMapper());
      json.writeStartObject();

      // Inputs
      json.writeFieldName("inputs");
      if (1 == inputs.size() && !(inputs.get(0) instanceof List)) {
        json.writeString(inputs.get(0).toString());
      } else if (inputs.size() > 0) {
        json.writeStartArray();
        for (Object obj : inputs) {
View Full Code Here

        }
        json.writeEndArray();
      }

      // Query
      json.writeFieldName("query");
      json.writeStartArray();
      for (MapReducePhase phase : phases) {
        json.writeStartObject();
        switch (phase.getPhase()) {
          case MAP:
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.