Package sk.antons.json.parse.traversal
Interface JsonContentHandler
public interface JsonContentHandler
Json event consumer. It is used together with Traversal parser
to generate events corresponding to json tree.
Each method can throw StopTraverse exception to regularry stop processing.
- Author:
- antons
-
Method Summary
Modifier and TypeMethodDescriptionHelp information for parser.voidendArray()End of the json array event.voidEnd of the json document event.voidEnd of the json object event.voidliteral(JsonLiteralImpl literal) Json literal event.voidName separaton json event.voidStart of the json array event.voidStart of the json document event.voidStart of the json object event.voidValue separator json event.voidwhiteSpace(String content, int offset, int length) white space json event
-
Method Details
-
contextInfo
String contextInfo()Help information for parser. It is used in case of error.- Returns:
- information about state of parsing.
-
startDocument
void startDocument()Start of the json document event. -
endDocument
void endDocument()End of the json document event. -
startArray
void startArray()Start of the json array event. -
endArray
void endArray()End of the json array event. -
startObject
void startObject()Start of the json object event. -
endObject
void endObject()End of the json object event. -
valueSeparator
void valueSeparator()Value separator json event. -
nameSeparator
void nameSeparator()Name separaton json event. -
literal
Json literal event.- Parameters:
literal- provided literal
-
whiteSpace
white space json event- Parameters:
content- String where whitespace is locatedoffset- start position of white space in contentlength- length of white space.
-