Examples of toJSONString()


Examples of org.auto.json.JsonSerializer.toJsonString()

    jsonObject.put("sdf", new JsonObject());
    jsonObject.put("khiyiu", null);
    array.add(jsonObject);
    array.add(new JsonObject());

    String jsonString = jsonSerializer.toJsonString(person);

    JsonDeserializer deserializer = new JsonDeserializer();
    Person dperson = (Person) deserializer.toObject(jsonString,
        Person.class);
View Full Code Here

Examples of org.fluxtream.core.mvc.models.CalendarModel.toJSONString()

        guestId = guest.getId();
        StringBuilder sb = new StringBuilder("module=API component=calendarController action=getModel")
                .append(" guestId=").append(guestId);
        logger.info(sb.toString());
        CalendarModel calendarModel = CalendarModel.fromState(guestId, metadataService, state);
        return calendarModel.toJSONString(env);
    }

}
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

        node.get("long").set(5L);
        node.get("string").set("Value");
        node.get("a", "b").set(true);
        node.get("c", "d").set(40);

        String json = node.toJSONString(false);
        String data = assertCast(String.class, converter.fromModelNode(node));
        Assert.assertEquals(json, data);

        Assert.assertEquals(ModelNode.fromJSONString(json), converter.toModelNode(data));
    }
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

            } else if (GET_ROLES_AS_JSON.equals(operationName)) {
                addressValidator.validate(operation);
                String json = serverControl.getRolesAsJSON(operation.require(ADDRESS_MATCH).asString());
                ModelNode camelCase = ModelNode.fromJSONString(json);
                ModelNode converted = CamelCaseUtil.convertSecurityRole(camelCase);
                json = converted.toJSONString(true);
                context.getResult().set(json);
            } else if (GET_ADDRESS_SETTINGS_AS_JSON.equals(operationName)) {
                addressValidator.validate(operation);
                String json = serverControl.getAddressSettingsAsJSON(operation.require(ADDRESS_MATCH).asString());
                context.getResult().set(json);
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

        op.get("operation").set("add");
        op.get("address").add("deployment", "test-http-deployment.sar");
        op.get("content").get(0).get("hash").set(hash);
        op.get("enabled").set(true);

        os.write(op.toJSONString(true).getBytes());
        os.flush();
    }

    private void writeRemoveRequest(BufferedOutputStream os) throws IOException {
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

        ModelNode op = new ModelNode();
        op.get("operation").set("remove");
        op.get("address").add("deployment", "test-http-deployment.sar");

        os.write(op.toJSONString(true).getBytes());
        os.flush();
    }

    private ModelNode readResult(final InputStream is) throws IOException, NoSuchElementException {
        return ModelNode.fromJSONStream(is);
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

        ModelNode value2 = new ModelNode();
        value2.get("long").set(10L);
        list.add(value2);

        String json1 = value1.toJSONString(false);
        String json2 = value2.toJSONString(false);
        String[] data = assertCast(String[].class, converter.fromModelNode(list));
        Assert.assertEquals(2, data.length);
        Assert.assertEquals(json1, data[0]);
        Assert.assertEquals(json2, data[1]);
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

        node.get("value", "long").set(1L);
        node.get("value", "string").set("test");

        CompositeData data = assertCast(CompositeData.class, converter.fromModelNode(node));
        Assert.assertEquals(type, data.getCompositeType());
        Assert.assertEquals(ModelNode.fromJSONString(node.toJSONString(false)), converter.toModelNode(data));

    }

    private OpenType<?> assertCompositeType(CompositeType composite, String name, String type, String description){
        return assertCompositeType(composite, name, type, description, true);
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

        final AddressControl addressControl = getAddressControl(context, operation);
        try {
            String json = addressControl.getRolesAsJSON();
            final ModelNode camelCase = ModelNode.fromJSONString(json);
            final ModelNode converted = CamelCaseUtil.convertSecurityRole(camelCase);
            context.getResult().set(converted.toJSONString(true));
            context.completeStep();
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            context.getFailureDescription().set(e.getLocalizedMessage());
View Full Code Here

Examples of org.jboss.dmr.ModelNode.toJSONString()

public class ManagementUtil {

    public static void reportRolesAsJSON(OperationContext context, String rolesAsJSON) {
        ModelNode camelCase = ModelNode.fromJSONString(rolesAsJSON);
        ModelNode converted = convertSecurityRole(camelCase);
        String json = converted.toJSONString(true);
        context.getResult().set(json);
    }

    public static void reportRoles(OperationContext context, String rolesAsJSON) {
        ModelNode camelCase = ModelNode.fromJSONString(rolesAsJSON);
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.