Package org.beanio.stream.json
Class JsonReaderSupport
- java.lang.Object
-
- org.beanio.stream.json.JsonReaderSupport
-
- Direct Known Subclasses:
JsonReader,JsonRecordUnmarshaller
public abstract class JsonReaderSupport extends java.lang.ObjectBase class for reading a JSON formatted stream.- Since:
- 2.0
- See Also:
JsonRecordParserFactory
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisWhitespace(char c)Returns whether the given character is whitespace.protected java.lang.ObjectparseValue(java.lang.String text)Parses a null, boolean or numeric value from the given text.protected java.util.List<java.lang.Object>readArray()Reads a JSON array from the input stream.protected java.util.Map<java.lang.String,java.lang.Object>readObject()Reads the next JSON object from the stream.protected java.lang.StringreadString()Reads a JSON string value from the input stream.protected charreadUnicode()Reads a Unicode character in JSON format.protected voidsetReader(java.io.Reader in)Set theReaderto read from.
-
-
-
Method Detail
-
setReader
protected void setReader(java.io.Reader in)
Set theReaderto read from.- Parameters:
in- theReader
-
readObject
protected java.util.Map<java.lang.String,java.lang.Object> readObject() throws java.io.IOExceptionReads the next JSON object from the stream.- Returns:
- the JSON object
Map - Throws:
java.io.IOException
-
readArray
protected java.util.List<java.lang.Object> readArray() throws java.io.IOExceptionReads a JSON array from the input stream.- Returns:
- the parsed JSON array
- Throws:
java.io.IOException
-
parseValue
protected java.lang.Object parseValue(java.lang.String text) throws java.io.IOExceptionParses a null, boolean or numeric value from the given text.- Parameters:
text- the text to parse- Returns:
- the parsed value: either null, Boolean, Double, Long or Integer
- Throws:
java.io.IOException
-
readString
protected java.lang.String readString() throws java.io.IOExceptionReads a JSON string value from the input stream.- Returns:
- the JSON string value
- Throws:
java.io.IOException
-
readUnicode
protected char readUnicode() throws java.io.IOExceptionReads a Unicode character in JSON format.- Returns:
- the Unicode character
- Throws:
java.io.IOException
-
isWhitespace
protected boolean isWhitespace(char c)
Returns whether the given character is whitespace.- Parameters:
c- the character to test- Returns:
- true if whitespace, false othereise
-
-