/** * Reads the next token from the tokeniser. * This method throws a ParseException when reading EOF. * * @param tokeniser * @param in * @param ignoreEOF * @return int value of the ttype field of the tokeniser * @throws ParseException When reading EOF. */ private int nextToken(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException { int token = tokeniser.nextToken(); if (!ignoreEOF && token == StreamTokenizer.TT_EOF) { throw new ParserException("Unexpected end of file", getLineNumber(tokeniser, in)); } return token; } }
/** * Reads the next token from the tokeniser. * This method throws a ParseException when reading EOF. * * @param tokeniser * @param in * @param ignoreEOF * @return int value of the ttype field of the tokeniser * @throws ParseException When reading EOF. */ private int nextToken(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException { int token = tokeniser.nextToken(); if (!ignoreEOF && token == StreamTokenizer.TT_EOF) { throw new ParserException("Unexpected end of file", getLineNumber(tokeniser, in)); } return token; } }
/** * Reads the next token from the tokeniser. * This method throws a ParseException when reading EOF. * * @param tokeniser * @param in * @param ignoreEOF * @return int value of the ttype field of the tokeniser * @throws ParseException When reading EOF. */ private int nextToken(StreamTokenizer tokeniser, Reader in, boolean ignoreEOF) throws IOException, ParserException { int token = tokeniser.nextToken(); if (!ignoreEOF && token == StreamTokenizer.TT_EOF) { throw new ParserException("Unexpected end of file", getLineNumber(tokeniser, in)); } return token; } }
/** * Asserts that the next token in the stream matches the specified token. * @param tokeniser stream tokeniser to perform assertion on * @param token expected token * @throws IOException when unable to read from stream * @throws ParserException when next token in the stream does not match the expected token */ private void assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { if (tokeniser.nextToken() != token) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, new Object[] { new Integer(token), new Integer(tokeniser.ttype), }), getLineNumber(tokeniser, in)); } if (log.isDebugEnabled()) { log.debug("[" + token + "]"); } }
/** * Reads the next token from the tokeniser. * This method throws a ParseException when reading EOF. * * @param tokeniser * @param in * @return * @throws ParseException When reading EOF. */ private int nextToken(StreamTokenizer tokeniser, Reader in) throws IOException, ParserException { int token = tokeniser.nextToken(); if (token == StreamTokenizer.TT_EOF) { throw new ParserException("Unexpected end of file", getLineNumber(tokeniser, in)); } return token; } }
/** * Asserts that the next token in the stream matches the specified token. * * @param tokeniser stream tokeniser to perform assertion on * @param token expected token * @throws IOException when unable to read from stream * @throws ParserException when next token in the stream does not match the expected token */ private void assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { if (nextToken(tokeniser, in) != token) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, tokeniser.ttype), getLineNumber(tokeniser, in)); } if (log.isDebugEnabled()) { log.debug("[" + token + "]"); } }
/** * Asserts that the next token in the stream matches the specified token. * * @param tokeniser stream tokeniser to perform assertion on * @param token expected token * @return int value of the ttype field of the tokeniser * @throws IOException when unable to read from stream * @throws ParserException when next token in the stream does not match the expected token */ private int assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { int ntok = nextToken(tokeniser, in); if (ntok != token) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, tokeniser.ttype), getLineNumber(tokeniser, in)); } if (log.isDebugEnabled()) { log.debug("[" + token + "]"); } return ntok; }
/** * Asserts that the next token in the stream matches the specified token. * * @param tokeniser stream tokeniser to perform assertion on * @param token expected token * @return int value of the ttype field of the tokeniser * @throws IOException when unable to read from stream * @throws ParserException when next token in the stream does not match the expected token */ private int assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { int ntok = nextToken(tokeniser, in); if (ntok != token) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, tokeniser.ttype), getLineNumber(tokeniser, in)); } if (log.isDebugEnabled()) { log.debug("[" + token + "]"); } return ntok; }
/** * Asserts that the next token in the stream matches the specified token. * * @param tokeniser stream tokeniser to perform assertion on * @param token expected token * @return int value of the ttype field of the tokeniser * @throws IOException when unable to read from stream * @throws ParserException when next token in the stream does not match the expected token */ private int assertToken(final StreamTokenizer tokeniser, Reader in, final int token) throws IOException, ParserException { int ntok = nextToken(tokeniser, in); if (ntok != token) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, tokeniser.ttype), getLineNumber(tokeniser, in)); } if (log.isDebugEnabled()) { log.debug("[" + token + "]"); } return ntok; }
/** * Asserts that the next token in the stream matches the specified token. * @param tokeniser stream tokeniser to perform assertion on * @param token expected token * @throws IOException when unable to read from stream * @throws ParserException when next token in the stream does not match the expected token */ private void assertToken(final StreamTokenizer tokeniser, Reader in, final String token, final boolean ignoreCase) throws IOException, ParserException { // ensure next token is a word token.. assertToken(tokeniser, in, StreamTokenizer.TT_WORD); if (ignoreCase) { if (!token.equalsIgnoreCase(tokeniser.sval)) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, new Object[] { token, tokeniser.sval, }), getLineNumber(tokeniser, in)); } } else if (!token.equals(tokeniser.sval)) { throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, new Object[] { token, tokeniser.sval, }), getLineNumber(tokeniser, in)); } if (log.isDebugEnabled()) { log.debug("[" + token + "]"); } }
throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in)); throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in));
throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in)); throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in));
throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in)); throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in));
throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in)); throw new ParserException(MessageFormat.format(UNEXPECTED_TOKEN_MESSAGE, token, sval), getLineNumber(tokeniser, in));
/** * {@inheritDoc} */ public final void parse(final Reader in, final ContentHandler handler) throws IOException, ParserException { final StreamTokenizer tokeniser = new StreamTokenizer(in); try { tokeniser.resetSyntax(); tokeniser.wordChars(WORD_CHAR_START, WORD_CHAR_END); tokeniser.whitespaceChars(WHITESPACE_CHAR_START, WHITESPACE_CHAR_END); tokeniser.ordinaryChar(':'); tokeniser.ordinaryChar(';'); tokeniser.ordinaryChar('='); tokeniser.ordinaryChar('\t'); tokeniser.eolIsSignificant(true); tokeniser.whitespaceChars(0, 0); tokeniser.quoteChar('"'); parseCalendarList(tokeniser, in, handler); } catch (IOException | ParseException | URISyntaxException | RuntimeException e) { if (e instanceof IOException) { throw (IOException) e; } if (e instanceof ParserException) { throw (ParserException) e; } else { throw new ParserException(e.getMessage(), getLineNumber(tokeniser, in), e); } } }
/** * {@inheritDoc} */ public final void parse(final Reader in, final ContentHandler handler) throws IOException, ParserException { final StreamTokenizer tokeniser = new StreamTokenizer(in); try { tokeniser.resetSyntax(); tokeniser.wordChars(WORD_CHAR_START, WORD_CHAR_END); tokeniser.whitespaceChars(WHITESPACE_CHAR_START, WHITESPACE_CHAR_END); tokeniser.ordinaryChar(':'); tokeniser.ordinaryChar(';'); tokeniser.ordinaryChar('='); tokeniser.ordinaryChar('\t'); tokeniser.eolIsSignificant(true); tokeniser.whitespaceChars(0, 0); tokeniser.quoteChar('"'); parseCalendarList(tokeniser, in, handler); } catch (IOException | ParseException | URISyntaxException | RuntimeException e) { if (e instanceof IOException) { throw (IOException) e; } if (e instanceof ParserException) { throw (ParserException) e; } else { throw new ParserException(e.getMessage(), getLineNumber(tokeniser, in), e); } } }
/** * {@inheritDoc} */ public final void parse(final Reader in, final ContentHandler handler) throws IOException, ParserException { final StreamTokenizer tokeniser = new StreamTokenizer(in); try { tokeniser.resetSyntax(); tokeniser.wordChars(WORD_CHAR_START, WORD_CHAR_END); tokeniser.whitespaceChars(WHITESPACE_CHAR_START, WHITESPACE_CHAR_END); tokeniser.ordinaryChar(':'); tokeniser.ordinaryChar(';'); tokeniser.ordinaryChar('='); tokeniser.ordinaryChar('\t'); tokeniser.eolIsSignificant(true); tokeniser.whitespaceChars(0, 0); tokeniser.quoteChar('"'); parseCalendarList(tokeniser, in, handler); } catch (Exception e) { if (e instanceof IOException) { throw (IOException) e; } if (e instanceof ParserException) { throw (ParserException) e; } else { throw new ParserException(e.getMessage(), getLineNumber(tokeniser, in), e); } } }
throw (ParserException) e; } else { throw new ParserException(e.getMessage(), getLineNumber(tokeniser, in), e);
throw new ParserException(e.getMessage(), getLineNumber(tokeniser, in), e);