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 class
Parser.FieldRef
private static class
Parser.JsonNodeFactoryImpl
private static class
Parser.TomlArrayNode
private static class
Parser.TomlObjectNode
-
Field Summary
Fields Modifier and Type Field Description private TomlStreamReadException.ErrorContext
errorContext
private static com.fasterxml.jackson.databind.node.JsonNodeFactory
factory
private Lexer
lexer
private static int
MAX_CHARS_TO_REPORT
private TomlToken
next
private int
options
private TomlFactory
tomlFactory
-
Constructor Summary
Constructors Modifier Constructor Description private
Parser(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) int
getNestingDepth()
private Parser.TomlArrayNode
getOrCreateArray(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String field)
private Parser.TomlObjectNode
getOrCreateObject(com.fasterxml.jackson.databind.node.ObjectNode node, java.lang.String field)
com.fasterxml.jackson.databind.node.ObjectNode
parse()
static com.fasterxml.jackson.databind.node.ObjectNode
parse(com.fasterxml.jackson.core.io.IOContext ioContext, int options, java.io.Reader reader)
Deprecated.static com.fasterxml.jackson.databind.node.ObjectNode
parse(TomlFactory tomlFactory, com.fasterxml.jackson.core.io.IOContext ioContext, java.io.Reader reader)
private Parser.FieldRef
parseAndEnterKey(Parser.TomlObjectNode outer, boolean forTable)
private com.fasterxml.jackson.databind.node.ArrayNode
parseArray(int nextState)
private com.fasterxml.jackson.databind.JsonNode
parseDateTime(int nextState)
private com.fasterxml.jackson.databind.JsonNode
parseFloat(int nextState)
private com.fasterxml.jackson.databind.node.ObjectNode
parseInlineTable(int nextState)
private com.fasterxml.jackson.databind.JsonNode
parseInt(int nextState)
private com.fasterxml.jackson.databind.node.ValueNode
parseIntFromBuffer(char[] buffer, int start, int length)
private void
parseKeyVal(Parser.TomlObjectNode target, int nextState)
private com.fasterxml.jackson.databind.JsonNode
parseValue(int nextState)
private TomlToken
peek()
private TomlToken
poll(int nextState)
Note: Polling also lexes the next token, so methods likeLexer.yytext()
will not work afterwardsprivate void
pollExpected(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.IOException
Deprecated.- 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
-
-