Class ElementParserContext

java.lang.Object
blue.endless.jankson.impl.ElementParserContext
All Implemented Interfaces:
ParserContext<AnnotatedElement>

public class ElementParserContext extends Object implements ParserContext<AnnotatedElement>
  • Constructor Details

    • ElementParserContext

      public ElementParserContext()
  • Method Details

    • consume

      public boolean consume(int codePoint, Jankson loader) throws SyntaxError
      Description copied from interface: ParserContext
      Consume 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:
      consume in interface ParserContext<AnnotatedElement>
      Throws:
      SyntaxError
    • setResult

      public void setResult(JsonElement elem)
    • eof

      public void eof() throws SyntaxError
      Description copied from interface: ParserContext
      Notifies 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:
      eof in interface ParserContext<AnnotatedElement>
      Throws:
      SyntaxError
    • isComplete

      public boolean isComplete()
      Description copied from interface: ParserContext
      Returns 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:
      isComplete in interface ParserContext<AnnotatedElement>
    • getResult

      public AnnotatedElement getResult() throws SyntaxError
      Description copied from interface: ParserContext
      Gets the result of parsing. Will be called only after isComplete reports true and processing of input has ceased.
      Specified by:
      getResult in interface ParserContext<AnnotatedElement>
      Throws:
      SyntaxError