Package blue.endless.jankson.impl
Class ArrayParserContext
java.lang.Object
blue.endless.jankson.impl.ArrayParserContext
- All Implemented Interfaces:
ParserContext<JsonArray>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanConsume one codepoint from the stream, and either use it to continue composing the result or to discover that the result is complete and processing should stop.voideof()Notifies this context that the file ended abruptly while in this context and before isComplete returned true.Gets the result of parsing.booleanReturns true if the parser has assembled a complete result.
-
Constructor Details
-
ArrayParserContext
public ArrayParserContext()Assumes the opening brace has already been consumed!
-
-
Method Details
-
consume
Description copied from interface:ParserContextConsume one codepoint from the stream, and either use it to continue composing the result or to discover that the result is complete and processing should stop. Throws a SyntaxError if unexpected or nonsense characters are encountered.- Specified by:
consumein interfaceParserContext<JsonArray>- Throws:
SyntaxError
-
eof
Description copied from interface:ParserContextNotifies this context that the file ended abruptly while in this context and before isComplete returned true. In some contexts, like a single-line comment, this is fine. In most contexts, this should throw a descriptive error.- Specified by:
eofin interfaceParserContext<JsonArray>- Throws:
SyntaxError
-
isComplete
public boolean isComplete()Description copied from interface:ParserContextReturns true if the parser has assembled a complete result. After true is returned, no more code points will be offered to consume, and getResult will soon be called to retrieve the result.- Specified by:
isCompletein interfaceParserContext<JsonArray>
-
getResult
Description copied from interface:ParserContextGets the result of parsing. Will be called only after isComplete reports true and processing of input has ceased.- Specified by:
getResultin interfaceParserContext<JsonArray>- Throws:
SyntaxError
-