public class JsonUnmarshallerContext extends Object
Modifier and Type | Field and Description |
---|---|
com.fasterxml.jackson.core.JsonToken |
currentToken
The current JsonToken that the private JsonParser is currently pointing to.
|
Constructor and Description |
---|
JsonUnmarshallerContext(com.fasterxml.jackson.core.JsonParser jsonParser) |
JsonUnmarshallerContext(com.fasterxml.jackson.core.JsonParser jsonParser,
HttpResponse httpResponse) |
Modifier and Type | Method and Description |
---|---|
int |
getCurrentDepth()
Returns the element depth of the parser's current position in the JSON
document being parsed.
|
String |
getCurrentParentElement()
Returns the name of the JSON field that is the nearest parent of the
current context.
|
String |
getHeader(String header)
Returns the value of the header with the specified name from the
response, or null if not present.
|
HttpResponse |
getHttpResponse() |
com.fasterxml.jackson.core.JsonParser |
getJsonParser() |
String |
getLastParsedParentElement()
This will return the deleted string in stackString when doing update on
the stack
|
Map<String,String> |
getMetadata()
Returns any metadata collected through metadata expressions while this
context was reading the JSON events from the JSON document.
|
boolean |
isStartOfDocument() |
com.fasterxml.jackson.core.JsonToken |
nextToken() |
com.fasterxml.jackson.core.JsonToken |
peek() |
String |
readText()
Returns the text of the current token, or throws an exception if
the current token does not contain text (ex: '{', '}', etc.).
|
void |
registerMetadataExpression(String expression,
int targetDepth,
String storageKey)
Registers an expression, which if matched, will cause the data for the
matching element to be stored in the metadata map under the specified
key.
|
boolean |
testExpression(String expression)
Tests the specified expression (a JSON field name) against the current
position in the JSON document being parsed.
|
boolean |
testExpression(String expression,
int stackDepth)
Tests the specified expression (a JSON field name) against the current
position in the JSON document being parsed, and restricts the expression
to matching at the specified stack depth.
|
String |
toString() |
public com.fasterxml.jackson.core.JsonToken currentToken
public JsonUnmarshallerContext(com.fasterxml.jackson.core.JsonParser jsonParser)
public JsonUnmarshallerContext(com.fasterxml.jackson.core.JsonParser jsonParser, HttpResponse httpResponse)
public String getHeader(String header)
header
- The name of the header to lookup.public HttpResponse getHttpResponse()
public int getCurrentDepth()
public String readText() throws IOException
IOException
public boolean isStartOfDocument()
public boolean testExpression(String expression)
expression
- The field name to test.public String getCurrentParentElement()
public boolean testExpression(String expression, int stackDepth)
expression
- The field name to test.stackDepth
- The depth in the stack representing where the expression must
start matching in order for this method to return true.public com.fasterxml.jackson.core.JsonToken nextToken() throws IOException
IOException
public com.fasterxml.jackson.core.JsonToken peek() throws IOException
IOException
public com.fasterxml.jackson.core.JsonParser getJsonParser()
public Map<String,String> getMetadata()
public void registerMetadataExpression(String expression, int targetDepth, String storageKey)
expression
- The expression an element must match in order for it's data to
be pulled out and stored in the metadata map.targetDepth
- The depth in the JSON document where the expression match must
start.storageKey
- The key under which to store the matching element's data.public String getLastParsedParentElement()
Copyright © 2016. All rights reserved.