Package javax.json

Examples of javax.json.JsonObjectBuilder.build()


                builder.add(node.getNodeName(), node.getTextContent());
            } else {
                builder.add(node.getNodeName(), new JsonNode(child).json());
            }
        }
        return builder.build();
    }

}
View Full Code Here


        for (Map.Entry<String, JsonValue> applicationEntry : applicationsSet) {
            final String applicationName = applicationEntry.getKey();
            JsonObject stats = collector.fetchApplicationStatistics(applicationName);
            builder.add(applicationName, stats);
        }
        return builder.build();
    }

    public JsonObject getApplicationContainerStatistics(String applicationName) {
        return collector.fetchApplicationStatistics(applicationName);
    }
View Full Code Here

                } else {
                    builder.add(beanName, beanStatistics);
                }
            }
        }
        return builder.build();
    }

    public JsonObject getBeanStatistics(String applicationName, String beanName) {
        JsonObjectBuilder builder = Json.createObjectBuilder();
        JsonObject components = collector.fetchMethods(applicationName, beanName);
View Full Code Here

                LOG.info("!!!NULL -> Beanname: " + beanName + " -> " + methodStatistics);
            } else {
                builder.add(methodName, methodStatistics);
            }
        }
        return builder.build();
    }

    public JsonObject getBeanPoolStatistics(String applicationName, String ejbName) {
        return collector.fetchBeanPoolStatistics(applicationName, ejbName);
    }
View Full Code Here

        builder.add("version", version);
        if (info != null) {
            uptime = info.getUptime();
        }
        builder.add("uptime", uptime);
        return builder.build();
    }

    @GET
    @Path("lightfish")
    public JsonObject lightfish() {
View Full Code Here

        }
        Set<Object> keySet = properties.keySet();
        for (Object object : keySet) {
            builder.add((String) object, (String) properties.get(object));
        }
        return builder.build();
    }
}
View Full Code Here

        String timeoutAsString = "-";
        if (nextTimeout != null) {
            timeoutAsString = nextTimeout.toString();
        }
        objectBuilder.add("nextTimeout", timeoutAsString).add(INTERVAL, configurator.getValue(INTERVAL));
        return objectBuilder.build();
    }

    @DELETE
    public void stopPolling() {
        controller.stopTimer();
View Full Code Here

                if (jsonObject.containsKey(key)) {
                    documentBuilder.add(key, jsonObject.get(key));
                }
            }

            final JsonObject document = documentBuilder.build();
            if (!document.isEmpty()) {
                documents.add(document);
            }
        }
View Full Code Here

    for(String error : this.errors) {
        errorBuilder.add(error);
    }
    builder.add("errors", errorBuilder);
   
    JsonObject jsonObject = builder.build();
    return jsonObject.toString();

  }
}
View Full Code Here

              sent.add(l.word());
            }
            senttokens.add(sentId, sent);
          }
          String sentfilename = constVars.outDir + "/" + constVars.identifier + "/sentences" + ".json";
          IOUtils.writeStringToFile(senttokens.build().toString(), sentfilename, "utf8");
        }
      }

    }
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.