Package com.google.gson

Examples of com.google.gson.Gson.fromJson()


                    + "\"}";
            method.setRequestEntity(new StringRequestEntity(body,
                    this.contentType, "UTF-8"));
            this.httpClient.executeMethod(method);
            Gson gson = new Gson();
            ResponseNode node = gson.fromJson(method.getResponseBodyAsString(),
                    ResponseNode.class);
            return node.getSelf();
        } catch (Exception e) {
            throw new RuntimeException(
                    "There was an error creating relationship." + nodeFrom
View Full Code Here


            GetMethod method = new GetMethod(this.baseUri
                    + this.createIndexUrlPath + "calls/callId/" + callId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            Gson gson = new Gson();
            Collection<ResponseNode> node = gson.fromJson(
                    method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String callnode = node.iterator().next().getSelf();
View Full Code Here

                    + "emergencies/emergencyId/" + emergencyId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            gson = new Gson();

            node = gson.fromJson(method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String emergencyNode = node.iterator().next().getSelf();
            this.createRelationship(callnode, emergencyNode,
                    EmergencyRelationshipType.CREATES.name());
View Full Code Here

                    + this.createIndexUrlPath + "emergencies/emergencyId/"
                    + emergencyId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            Gson gson = new Gson();
            Collection<ResponseNode> node = gson.fromJson(
                    method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String emergencynode = node.iterator().next().getSelf();
View Full Code Here

                    + "procedures/procedureId/" + procedureId);
            method.addRequestHeader("Accept", this.contentType);
            method.addRequestHeader("Content-Type", this.contentType);
            this.httpClient.executeMethod(method);
            gson = new Gson();
            node = gson.fromJson(method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String callNode = node.iterator().next().getSelf();
            this.createRelationship(emergencynode, callNode,
                    EmergencyRelationshipType.INSTANTIATE.name());
View Full Code Here

                    + this.createIndexUrlPath + "procedures/procedureId/"
                    + parentProcedureId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            Gson gson = new Gson();
            Collection<ResponseNode> node = gson.fromJson(
                    method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());

            String parentNode = node.iterator().next().getSelf();
View Full Code Here

                    + "procedures/procedureId/" + childProcedureId);
            method.addRequestHeader("Accept", this.contentType);
            method.addRequestHeader("Content-Type", this.contentType);
            this.httpClient.executeMethod(method);
            gson = new Gson();
            node = gson.fromJson(method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String childNode = node.iterator().next().getSelf();
            this.createRelationship(parentNode, childNode,
                    EmergencyRelationshipType.SUB.name());
View Full Code Here

                    + this.createIndexUrlPath + "procedures/procedureId/"
                    + procedureId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            Gson gson = new Gson();
            Collection<ResponseNode> node = gson.fromJson(
                    method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String procedureNode = node.iterator().next().getSelf();
View Full Code Here

            method = new GetMethod(this.baseUri + this.createIndexUrlPath
                    + "vehicles/vehicleId/" + vehicleId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            gson = new Gson();
            node = gson.fromJson(method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String vehicleNode = node.iterator().next().getSelf();
            this.createRelationship(procedureNode, vehicleNode,
                    EmergencyRelationshipType.USE.name());
View Full Code Here

                    + this.createIndexUrlPath + "emergencies/emergencyId/"
                    + emergencyId);
            method.addRequestHeader("Accept", this.contentType);
            this.httpClient.executeMethod(method);
            Gson gson = new Gson();
            Collection<ResponseNode> node = gson.fromJson(
                    method.getResponseBodyAsString(),
                    new TypeToken<Collection<ResponseNode>>() {
                    }.getType());
            String emergencynode = node.iterator().next().getSelf();
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.