Class Parser
- java.lang.Object
-
- com.fasterxml.jackson.dataformat.toml.Parser
-
class Parser extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classParser.FieldRefprivate static classParser.JsonNodeFactoryImplprivate static classParser.TomlArrayNodeprivate static classParser.TomlObjectNode
-
Field Summary
Fields Modifier and Type Field Description private TomlStreamReadException.ErrorContexterrorContextprivate static com.fasterxml.jackson.databind.node.JsonNodeFactoryfactoryprivate Lexerlexerprivate static intMAX_CHARS_TO_REPORTprivate TomlTokennextprivate intoptionsprivate TomlFactorytomlFactory
-
Constructor Summary
Constructors Modifier Constructor Description privateParser(TomlFactory tomlFactory, com.fasterxml.jackson.core.io.IOContext ioContext, TomlStreamReadException.ErrorContext errorContext, int options, java.io.Reader reader)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description (package private) intgetNestingDepth()private Parser.TomlArrayNodegetOrCreateArray(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String field)private Parser.TomlObjectNodegetOrCreateObject(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String field)com.fasterxml.jackson.databind.node.ObjectNodeparse()static com.fasterxml.jackson.databind.node.ObjectNodeparse(com.fasterxml.jackson.core.io.IOContext ioContext, int options, java.io.Reader reader)Deprecated.static com.fasterxml.jackson.databind.node.ObjectNodeparse(TomlFactory tomlFactory, com.fasterxml.jackson.core.io.IOContext ioContext, java.io.Reader reader)private Parser.FieldRefparseAndEnterKey(Parser.TomlObjectNode outer, boolean forTable)private com.fasterxml.jackson.databind.node.ArrayNodeparseArray(int nextState)private com.fasterxml.jackson.databind.JsonNodeparseDateTime(int nextState)private com.fasterxml.jackson.databind.JsonNodeparseFloat(int nextState)private com.fasterxml.jackson.databind.node.ObjectNodeparseInlineTable(int nextState)private com.fasterxml.jackson.databind.JsonNodeparseInt(int nextState)private com.fasterxml.jackson.databind.node.ValueNodeparseIntFromBuffer(char[] buffer, int start, int length)private voidparseKeyVal(Parser.TomlObjectNode target, int nextState)private com.fasterxml.jackson.databind.JsonNodeparseValue(int nextState)private TomlTokenpeek()private TomlTokenpoll(int nextState)Note: Polling also lexes the next token, so methods likeLexer.yytext()will not work afterwardsprivate voidpollExpected(TomlToken expected, int nextState)
-
-
-
Field Detail
-
factory
private static final com.fasterxml.jackson.databind.node.JsonNodeFactory factory
-
MAX_CHARS_TO_REPORT
private static final int MAX_CHARS_TO_REPORT
- See Also:
- Constant Field Values
-
tomlFactory
private final TomlFactory tomlFactory
-
errorContext
private final TomlStreamReadException.ErrorContext errorContext
-
options
private final int options
-
lexer
private final Lexer lexer
-
next
private TomlToken next
-
-
Constructor Detail
-
Parser
private Parser(TomlFactory tomlFactory, com.fasterxml.jackson.core.io.IOContext ioContext, TomlStreamReadException.ErrorContext errorContext, int options, java.io.Reader reader) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
parse
@Deprecated public static com.fasterxml.jackson.databind.node.ObjectNode parse(com.fasterxml.jackson.core.io.IOContext ioContext, int options, java.io.Reader reader) throws java.io.IOExceptionDeprecated.- Throws:
java.io.IOException
-
parse
public static com.fasterxml.jackson.databind.node.ObjectNode parse(TomlFactory tomlFactory, com.fasterxml.jackson.core.io.IOContext ioContext, java.io.Reader reader) throws java.io.IOException
- Parameters:
tomlFactory- factory with configurationioContext- I/O contextreader- character stream- Returns:
- parsed
ObjectNode - Throws:
java.io.IOException- if there are I/O issues- Since:
- v2.15
-
getNestingDepth
int getNestingDepth()
-
peek
private TomlToken peek() throws TomlStreamReadException
- Throws:
TomlStreamReadException
-
poll
private TomlToken poll(int nextState) throws java.io.IOException
Note: Polling also lexes the next token, so methods likeLexer.yytext()will not work afterwards- Throws:
java.io.IOException
-
pollExpected
private void pollExpected(TomlToken expected, int nextState) throws java.io.IOException
- Throws:
java.io.IOException
-
parse
public com.fasterxml.jackson.databind.node.ObjectNode parse() throws java.io.IOException- Throws:
java.io.IOException
-
parseAndEnterKey
private Parser.FieldRef parseAndEnterKey(Parser.TomlObjectNode outer, boolean forTable) throws java.io.IOException
- Throws:
java.io.IOException
-
parseValue
private com.fasterxml.jackson.databind.JsonNode parseValue(int nextState) throws java.io.IOException- Throws:
java.io.IOException
-
parseDateTime
private com.fasterxml.jackson.databind.JsonNode parseDateTime(int nextState) throws java.io.IOException- Throws:
java.io.IOException
-
parseInt
private com.fasterxml.jackson.databind.JsonNode parseInt(int nextState) throws java.io.IOException- Throws:
java.io.IOException
-
parseIntFromBuffer
private com.fasterxml.jackson.databind.node.ValueNode parseIntFromBuffer(char[] buffer, int start, int length) throws TomlStreamReadException- Throws:
TomlStreamReadException
-
parseFloat
private com.fasterxml.jackson.databind.JsonNode parseFloat(int nextState) throws java.io.IOException- Throws:
java.io.IOException
-
parseInlineTable
private com.fasterxml.jackson.databind.node.ObjectNode parseInlineTable(int nextState) throws java.io.IOException- Throws:
java.io.IOException
-
parseArray
private com.fasterxml.jackson.databind.node.ArrayNode parseArray(int nextState) throws java.io.IOException- Throws:
java.io.IOException
-
parseKeyVal
private void parseKeyVal(Parser.TomlObjectNode target, int nextState) throws java.io.IOException
- Throws:
java.io.IOException
-
getOrCreateObject
private Parser.TomlObjectNode getOrCreateObject(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String field) throws TomlStreamReadException
- Throws:
TomlStreamReadException
-
getOrCreateArray
private Parser.TomlArrayNode getOrCreateArray(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String field) throws TomlStreamReadException
- Throws:
TomlStreamReadException
-
-