@Override /* ParserReader */ public final UonReader unread() throws IOException { super.unread(); return this; } }
@Override /* ParserReader */ public final UonReader unread() throws IOException { super.unread(); return this; } }
@Override /* ParserReader */ public final UonReader unread() throws IOException { super.unread(); return this; } }
private static void skipSpace(ParserReader r) throws Exception { int c = 0; while ((c = r.read()) != -1) { if (c <= 2 || ! Character.isWhitespace(c)) { r.unread(); return; } } }
private static void skipSpace(ParserReader r) throws Exception { int c = 0; while ((c = r.read()) != -1) { if (c <= 2 || ! Character.isWhitespace(c)) { r.unread(); return; } } }
private static void skipSpace(ParserReader r) throws Exception { int c = 0; while ((c = r.read()) != -1) { if (c <= 2 || ! Character.isWhitespace(c)) { r.unread(); return; } } }
/** * Peeks the next character in the stream. * * <p> * This is equivalent to doing a {@code read()} followed by an {@code unread()}. * * @return The peeked character, or (char)-1 if the end of the stream has been reached. * @throws IOException If a problem occurred trying to read from the reader. */ public final int peek() throws IOException { int c = read(); if (c != -1) unread(); return c; }
/** * Peeks the next character in the stream. * * <p> * This is equivalent to doing a {@code read()} followed by an {@code unread()}. * * @return The peeked character, or (char)-1 if the end of the stream has been reached. * @throws IOException If a problem occurred trying to read from the reader. */ public final int peek() throws IOException { int c = read(); if (c != -1) unread(); return c; }
/** * Peeks the next character in the stream. * * <p> * This is equivalent to doing a {@code read()} followed by an {@code unread()}. * * @return The peeked character, or (char)-1 if the end of the stream has been reached. * @throws IOException If a problem occurred trying to read from the reader. */ public final int peek() throws IOException { int c = read(); if (c != -1) unread(); return c; }
/** * Same as {@link #peek()} but skips over any whitespace characters. * * <p> * This is equivalent to doing a {@code read()} followed by an {@code unread()}. * * @return The peeked character, or (char)-1 if the end of the stream has been reached. * @throws IOException If a problem occurred trying to read from the reader. */ public final int peekSkipWs() throws IOException { while(true) { int c = read(); boolean isWs = Character.isWhitespace(c); if (c != -1 && ! isWs) unread(); if (! isWs) return c; } }
/** * Same as {@link #peek()} but skips over any whitespace characters. * * <p> * This is equivalent to doing a {@code read()} followed by an {@code unread()}. * * @return The peeked character, or (char)-1 if the end of the stream has been reached. * @throws IOException If a problem occurred trying to read from the reader. */ public final int peekSkipWs() throws IOException { while(true) { int c = read(); boolean isWs = Character.isWhitespace(c); if (c != -1 && ! isWs) unread(); if (! isWs) return c; } }
/** * Same as {@link #peek()} but skips over any whitespace characters. * * <p> * This is equivalent to doing a {@code read()} followed by an {@code unread()}. * * @return The peeked character, or (char)-1 if the end of the stream has been reached. * @throws IOException If a problem occurred trying to read from the reader. */ public final int peekSkipWs() throws IOException { while(true) { int c = read(); boolean isWs = Character.isWhitespace(c); if (c != -1 && ! isWs) unread(); if (! isWs) return c; } }
/** * Reads a numeric string from the specified reader. * * @param r The reader to read form. * @return The parsed number string. * @throws Exception */ public static String parseNumberString(ParserReader r) throws Exception { r.mark(); int c = 0; while (true) { c = r.read(); if (c == -1) break; if (! numberChars.contains((char)c)) { r.unread(); break; } } return r.getMarked(); }
/** * Reads a numeric string from the specified reader. * * @param r The reader to read form. * @return The parsed number string. * @throws Exception */ public static String parseNumberString(ParserReader r) throws Exception { r.mark(); int c = 0; while (true) { c = r.read(); if (c == -1) break; if (! numberChars.contains((char)c)) { r.unread(); break; } } return r.getMarked(); }
private void skipCommentsAndSpace(ParserReader r) throws Exception { int c = 0; while ((c = r.read()) != -1) { if (! isWhitespace(c)) { if (c == '/') { if (isStrict()) throw new ParseException(this, "Javascript comment detected."); skipComments(r); } else { r.unread(); return; } } } }
private void skipCommentsAndSpace(ParserReader r) throws Exception { int c = 0; while ((c = r.read()) != -1) { if (! isWhitespace(c)) { if (c == '/') { if (isStrict()) throw new ParseException(this, "Javascript comment detected."); skipComments(r); } else { r.unread(); return; } } } }
private void skipCommentsAndSpace(ParserReader r) throws Exception { int c = 0; while ((c = r.read()) != -1) { if (! isWhitespace(c)) { if (c == '/') { if (isStrict()) throw new ParseException(this, "Javascript comment detected."); skipComments(r); } else { r.unread(); return; } } } }
private String parseFieldName(ParserReader r) throws Exception { int c = r.peek(); if (c == '\'' || c == '"') return parseString(r); if (isStrict()) throw new ParseException(this, "Unquoted attribute detected."); if (! VALID_BARE_CHARS.contains(c)) throw new ParseException(this, "Could not find the start of the field name."); r.mark(); // Look for whitespace. while (c != -1) { c = r.read(); if (! VALID_BARE_CHARS.contains(c)) { r.unread(); String s = r.getMarked().intern(); return s.equals("null") ? null : s; } } throw new ParseException(this, "Could not find the end of the field name."); }
private String parseFieldName(ParserReader r) throws Exception { int c = r.peek(); if (c == '\'' || c == '"') return parseString(r); if (isStrict()) throw new ParseException(this, "Unquoted attribute detected."); if (! VALID_BARE_CHARS.contains(c)) throw new ParseException(this, "Could not find the start of the field name."); r.mark(); // Look for whitespace. while (c != -1) { c = r.read(); if (! VALID_BARE_CHARS.contains(c)) { r.unread(); String s = r.getMarked().intern(); return s.equals("null") ? null : s; } } throw new ParseException(this, "Could not find the end of the field name."); }
private String parseFieldName(ParserReader r) throws Exception { int c = r.peek(); if (c == '\'' || c == '"') return parseString(r); if (isStrict()) throw new ParseException(this, "Unquoted attribute detected."); if (! VALID_BARE_CHARS.contains(c)) throw new ParseException(this, "Could not find the start of the field name."); r.mark(); // Look for whitespace. while (c != -1) { c = r.read(); if (! VALID_BARE_CHARS.contains(c)) { r.unread(); String s = r.getMarked().intern(); return s.equals("null") ? null : s; } } throw new ParseException(this, "Could not find the end of the field name."); }