Package org.codehaus.jackson

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


    public void testWrapppingNull() throws Exception {
        StringWriter sw = new StringWriter();
        JsonGenerator g = (new JsonFactory()).createJsonGenerator(sw);
        JsonGenerator awg = JacksonArrayWrapperGenerator.createArrayWrapperGenerator(g);
        awg.writeNull();
        awg.close();
        assertEquals("[]",sw.toString());
    }

    public void testWrapppingDoubleNull() throws Exception {
View Full Code Here


    public void testWrapppingDoubleNull() throws Exception {
        StringWriter sw = new StringWriter();
        JsonGenerator g = (new JsonFactory()).createJsonGenerator(sw);
        JsonGenerator awg = JacksonArrayWrapperGenerator.createArrayWrapperGenerator(g);
        awg.writeNull();
        awg.writeNull();
        awg.close();
        assertEquals("[null,null]",sw.toString());
    }
View Full Code Here

    public void testWrapppingDoubleNull() throws Exception {
        StringWriter sw = new StringWriter();
        JsonGenerator g = (new JsonFactory()).createJsonGenerator(sw);
        JsonGenerator awg = JacksonArrayWrapperGenerator.createArrayWrapperGenerator(g);
        awg.writeNull();
        awg.writeNull();
        awg.close();
        assertEquals("[null,null]",sw.toString());
    }

    public void testWrapppingString() throws Exception {
View Full Code Here

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

            generator.writeArrayFieldStart(ExpressionEditorMessageTokens.CONDITIONS_TOKEN);
            if (message.getExpression().getConditions().size() > 0) {
                for (Condition condition : message.getExpression().getConditions()) {
View Full Code Here

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

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

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

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

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

        generator.writeEndObject();

        generator.close();
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.