Package de.marhali.json5.stream
Class Json5Parser
- java.lang.Object
-
- de.marhali.json5.stream.Json5Parser
-
public final class Json5Parser extends java.lang.ObjectA parser to parse tokenized Json5 data into a parse tree ofJson5Element's.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Json5Elementparse(Json5Lexer lexer)Parses the specifiedlexerinto a parse tree ofJson5Element's.static Json5ArrayparseArray(Json5Lexer lexer)Parses the specifiedlexerinto a parse tree of anJson5Array.static Json5ObjectparseObject(Json5Lexer lexer)Parses the specifiedlexerinto a parse tree of anJson5Object.
-
-
-
Method Detail
-
parse
public static Json5Element parse(Json5Lexer lexer)
Parses the specifiedlexerinto a parse tree ofJson5Element's. Thereby it does not matter if the provided root element is an array or object.- Parameters:
lexer- Tokenized json5 data- Returns:
- a parse tree of
Json5Element's corresponding to the specified JSON5 ornullif lexer does not provide any data
-
parseObject
public static Json5Object parseObject(Json5Lexer lexer)
Parses the specifiedlexerinto a parse tree of anJson5Object. If the provided data does not correspond to aJson5ObjectaJson5Exceptionwill be thrown.- Parameters:
lexer- Tokenized json5 data.- Returns:
- a parse tree of
Json5Objectcorresponding to the specified JSON5. - See Also:
parse(Json5Lexer)
-
parseArray
public static Json5Array parseArray(Json5Lexer lexer)
Parses the specifiedlexerinto a parse tree of anJson5Array. If the provided data does not correspond to a json array aJson5Exceptionwill be thrown.- Parameters:
lexer- Tokenized json5 data.- Returns:
- a parse tree of
Json5Arraycorresponding to the specified JSON5. - See Also:
parse(Json5Lexer)
-
-