Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.infinispan.schematic.internal.document
Class JsonReader.Tokenizer

    java.lang.Object
      org.infinispan.schematic.internal.document.JsonReader.Tokenizer

Enclosing class:
  JsonReader

    @NotThreadSafe
    public static class JsonReader.Tokenizer

extends Object

The component that tokenizes a stream of JSON content.

Since:
  5.1
Author:
  Randall Hauch (C) 2011 Red Hat Inc.

Constructor Summary
`JsonReader.Tokenizer(Reader reader)` Create a new tokenizer that uses the supplied `Java IO Reader` instance.

Method Summary
`int` | `columnNumber()`
`protected String` | `complete(StringBuilder sb)`
`ParsingException` | `error(String message)`
`ParsingException` | `error(String message, Throwable t)`
`boolean` | `isFinished()`
`int` | `lineNumber()`
`protected char` | `next()`
`String` | `next(int characterCount)`
`boolean` | `nextDocumentDelim()` Consume the next document delimiter (either a ',' or a ';'), and return whether the end-of-document character (e.g., '}') has been consumed.
`void` | `nextFieldDelim()`
`String` | `nextNumber()` Return a string containing the next number on the stream.
`String` | `nextString()` Read the next quoted string from the stream, where stream begins with the a single-quote or double-quote character and the string ends with the same quote character.
`String` | `nextString(char endQuote)`
`char` | `nextUsefulChar()`
`String` | `nextWord()` Return a string containing the next alpha-numeric word on the stream.
`char` | `peek()`
`protected StringBuilder` | `stringBuilder()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### JsonReader.Tokenizer

    public JsonReader.Tokenizer(Reader reader)

  Create a new tokenizer that uses the supplied `Java IO Reader` instance.

  Parameters:
    `reader` - the reader for accessing the JSON content; may not be null

Method Detail

### isFinished

    public boolean isFinished()

### next

    protected char next()
                 throws ParsingException

  Throws:
    `ParsingException`

### next

    public String next(int characterCount)
                throws ParsingException

  Throws:
    `ParsingException`

### stringBuilder

    protected final StringBuilder stringBuilder()

### complete

    protected final String complete(StringBuilder sb)

### nextUsefulChar

    public char nextUsefulChar()
                        throws ParsingException

  Throws:
    `ParsingException`

### peek

    public char peek()
              throws ParsingException

  Throws:
    `ParsingException`

### nextString

    public String nextString()
                      throws ParsingException

  Read the next quoted string from the stream, where stream begins with the a single-quote or double-quote character and the string ends with the same quote character.

  Returns:
    the next string; never null
  Throws:
    `ParsingException`

### nextString

    public String nextString(char endQuote)
                      throws ParsingException

  Throws:
    `ParsingException`

### nextFieldDelim

    public void nextFieldDelim()
                        throws ParsingException

  Throws:
    `ParsingException`

### nextDocumentDelim

    public boolean nextDocumentDelim()
                              throws ParsingException

  Consume the next document delimiter (either a ',' or a ';'), and return whether the end-of-document character (e.g., '}') has been consumed. This will correctly handle repeated delimiters, which are technically incorrect.

  Returns:
    true if a '}' has been consumed, or false otherwise
  Throws:
    `ParsingException` - if the document delimiter could not be read

### nextNumber

    public String nextNumber()
                      throws ParsingException

  Return a string containing the next number on the stream.

  Returns:
    the next number as a string, or null if there is no content on the stream
  Throws:
    `ParsingException` - if the number could not be read

### nextWord

    public String nextWord()
                    throws ParsingException

  Return a string containing the next alpha-numeric word on the stream.

  Returns:
    the next word as a string
  Throws:
    `ParsingException` - if the number could not be read

### error

    public ParsingException error(String message)

### error

    public ParsingException error(String message,
                                  Throwable t)

### lineNumber

    public int lineNumber()

### columnNumber

    public int columnNumber()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Alpha5
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.