Package javax.json.stream

Examples of javax.json.stream.JsonParsingException


        }
    }

    private Object readDataFragment(boolean bigEndian) {
        if (next() != Event.KEY_NAME) {
            throw new JsonParsingException("Unexpected " + event
                    + ", expected \"InlineBinary\""
                    + " or \"BulkDataURI\"", location);
        }
        String key = getString();
        Object value;
        if ("BulkDataURI".equals(key)) {
            value = readBulkData(bigEndian);
        } else if ("InlineBinary".equals(key)) {
            value = readInlineBinary();
        } else {
            throw new JsonParsingException("Unexpected \"" + key
                    + "\", expected \"InlineBinary\""
                    + " or \"BulkDataURI\"", location);
        }
        if (next() != Event.END_OBJECT) {
            throw new JsonParsingException("Unexpected " + event
                    + " expected end of data fragment object", location);
        }
        return value;
    }
View Full Code Here


        }
    }

    private JsonParsingException parsingException(JsonToken token, String expectedTokens) {
        JsonLocation location = getLastCharLocation();
        return new JsonParsingException(
                JsonMessages.PARSER_INVALID_TOKEN(token, location, expectedTokens), location);
    }
View Full Code Here

        @Override
        public boolean hasNext() {
            if (stack.isEmpty() && (currentEvent == Event.END_ARRAY || currentEvent == Event.END_OBJECT)) {
                JsonToken token = tokenizer.nextToken();
                if (token != JsonToken.EOF) {
                    throw new JsonParsingException(JsonMessages.PARSER_EXPECTED_EOF(token),
                            getLastCharLocation());
                }
                return false;
            }
            return true;
View Full Code Here

        bufferPool.recycle(buf);
    }

    private JsonParsingException unexpectedChar(int ch) {
        JsonLocation location = getLastCharLocation();
        return new JsonParsingException(
            JsonMessages.TOKENIZER_UNEXPECTED_CHAR(ch, location), location);
    }
View Full Code Here

            JsonMessages.TOKENIZER_UNEXPECTED_CHAR(ch, location), location);
    }

    private JsonParsingException expectedChar(int unexpected, char expected) {
        JsonLocation location = getLastCharLocation();
        return new JsonParsingException(
                JsonMessages.TOKENIZER_EXPECTED_CHAR(unexpected, location, expected), location);
    }
View Full Code Here

TOP

Related Classes of javax.json.stream.JsonParsingException

Copyright © 2018 www.massapicom. 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.