Examples of JsonGenerationException


Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator write(String name, JsonValue value) {
        if (currentContext.scope != Scope.IN_OBJECT) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        switch (value.getValueType()) {
            case ARRAY:
                JsonArray array = (JsonArray)value;
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

        return this;
    }

    public JsonGenerator write(String value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeComma();
        writeEscapedString(value);
        return this;
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }


    public JsonGenerator write(int value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeComma();
        writeInt(value);
        return this;
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator write(long value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeValue(String.valueOf(value));
        return this;
    }
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator write(double value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        if (Double.isInfinite(value) || Double.isNaN(value)) {
            throw new NumberFormatException(JsonMessages.GENERATOR_DOUBLE_INFINITE_NAN());
        }
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator write(BigInteger value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeValue(value.toString());
        return this;
    }
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator write(BigDecimal value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeValue(value.toString());
        return this;
    }
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

        return this;
    }

    public JsonGenerator write(boolean value) {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeComma();
        writeString(value ? "true" : "false");
        return this;
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

        return this;
    }

    public JsonGenerator writeNull() {
        if (currentContext.scope != Scope.IN_ARRAY) {
            throw new JsonGenerationException(
                    JsonMessages.GENERATOR_ILLEGAL_METHOD(currentContext.scope));
        }
        writeComma();
        writeString("null");
        return this;
View Full Code Here

Examples of javax.json.stream.JsonGenerationException

    }

    @Override
    public JsonGenerator writeEnd() {
        if (currentContext.scope == Scope.IN_NONE) {
            throw new JsonGenerationException("writeEnd() cannot be called in no context");
        }
        writeChar(currentContext.scope == Scope.IN_ARRAY ? ']' : '}');
        currentContext = stack.pop();
        return this;
    }
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.