Package javax.json

Examples of javax.json.JsonObject.entrySet()


    public JsonObject json() throws IOException {
        final JsonObject obj = new JsonNode(
            this.storage.xml().nodes(this.xpath()).get(0)
        ).json();
        final JsonObjectBuilder json = Json.createObjectBuilder();
        for (final Map.Entry<String, JsonValue> val : obj.entrySet()) {
            json.add(val.getKey(), val.getValue());
        }
        return json
            .add(
                "comments",
View Full Code Here


        for (final JsonValue val : trees) {
            final JsonObject tree = (JsonObject) val;
            final String sha = tree.getString("sha");
            final Directives dirs = new Directives().xpath(this.xpath())
                .add("tree");
            for (final Entry<String, JsonValue> entry : tree.entrySet()) {
                dirs.add(entry.getKey()).set(entry.getValue().toString()).up();
            }
            this.storage.apply(dirs);
            final String ref;
            if (tree.containsValue("name")) {
View Full Code Here

    public JsonObject json() throws IOException {
        final JsonObject obj = new JsonNode(
            this.storage.xml().nodes(this.xpath()).get(0)
        ).json();
        final JsonObjectBuilder json = Json.createObjectBuilder();
        for (final Map.Entry<String, JsonValue> val: obj.entrySet()) {
            json.add(val.getKey(), val.getValue());
        }
        final JsonArrayBuilder array = Json.createArrayBuilder();
        for (final Label label : this.labels().iterate()) {
            array.add(
View Full Code Here

    Log LOG;

    public JsonObject getApplicationsContainerStatistics() {
        JsonObjectBuilder builder = Json.createObjectBuilder();
        JsonObject applications = collector.fetchApplications();
        Set<Map.Entry<String, JsonValue>> applicationsSet = applications.entrySet();
        for (Map.Entry<String, JsonValue> applicationEntry : applicationsSet) {
            final String applicationName = applicationEntry.getKey();
            JsonObject stats = collector.fetchApplicationStatistics(applicationName);
            builder.add(applicationName, stats);
        }
View Full Code Here

    }

    public JsonObject getBeanStatistics(String applicationName) {
        JsonObjectBuilder builder = Json.createObjectBuilder();
        JsonObject components = collector.fetchApplicationComponents(applicationName);
        Set<Map.Entry<String, JsonValue>> entrySet = components.entrySet();
        for (Map.Entry<String, JsonValue> entry : entrySet) {
            String beanName = entry.getKey();
            if (!"server".equals(beanName)) {
                final JsonObject beanStatistics = getBeanStatistics(applicationName, beanName);
                if (beanName == null || beanStatistics == null) {
View Full Code Here

        JsonObjectBuilder builder = Json.createObjectBuilder();
        JsonObject components = collector.fetchMethods(applicationName, beanName);
        if (components == null) {
            return builder.addNull("-- no methods --").build();
        }
        Set<Map.Entry<String, JsonValue>> entrySet = components.entrySet();
        for (Map.Entry<String, JsonValue> component : entrySet) {
            String methodName = component.getKey();
            JsonObject methodStatistics = collector.fetchMethodStatistics(applicationName, beanName, methodName);
            if (beanName == null || methodStatistics == null) {
                LOG.info("!!!NULL -> Beanname: " + beanName + " -> " + methodStatistics);
View Full Code Here

    List<String> getInstances() {
        this.managementResource = this.client.target(getInstancesUri());
        JsonObject serverResult = getJsonObject("server");
        JsonObject extraProperties = serverResult.getJsonObject("extraProperties");
        JsonObject result = extraProperties.getJsonObject("childResources");
        Set<Map.Entry<String, JsonValue>> entrySet = result.entrySet();
        List<String> instanceNames = new ArrayList<>();
        for (Map.Entry<String, JsonValue> entry : entrySet) {
            instanceNames.add(entry.getKey());
        }
        return instanceNames;
View Full Code Here

        Response result = managementResource.path("/")
                .request(MediaType.APPLICATION_JSON_TYPE)
                .get(Response.class);
        JsonObject entity = result.readEntity(JsonObject.class);
        JsonObject deployments = entity.getJsonObject("deployment");
        for (Map.Entry<String, JsonValue> entry : deployments.entrySet()) {
            apps.add(entry.getKey());
        }
        return apps;
    }
View Full Code Here

        if (jsonValue.getValueType() == ValueType.OBJECT) {
            contentHandler.startDocument();
            JsonObject jsonObject = (JsonObject) jsonValue;

            Set<Entry<String, JsonValue>> children = jsonObject.entrySet();
            if (children == null || children.size() == 0 && unmarshalClass == null) {
                return;
            }

            Iterator<Entry<String, JsonValue>> iter = children.iterator();
View Full Code Here

        } else if (valueType == ValueType.NUMBER) {
            JsonNumber number = ((JsonNumber)jsonValue);
            contentHandler.characters(number.toString());                
        } else if (valueType == ValueType.OBJECT) {
            JsonObject childObject = (JsonObject) jsonValue;
            Iterator<Entry<String, JsonValue>> iter = childObject.entrySet().iterator();
            while (iter.hasNext()) {
                Entry<String, JsonValue> nextEntry = iter.next();
                parsePair(nextEntry.getKey(), nextEntry.getValue());
            }
        } else if(valueType == ValueType.ARRAY) {
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.