public class JsonUnmarshallerContextImpl extends JsonUnmarshallerContext
JsonUnmarshallerContext.UnmarshallerType
Constructor and Description |
---|
JsonUnmarshallerContextImpl(com.fasterxml.jackson.core.JsonParser jsonParser,
Map<Class<?>,Unmarshaller<?,JsonUnmarshallerContext>> mapper,
HttpResponse httpResponse) |
JsonUnmarshallerContextImpl(com.fasterxml.jackson.core.JsonParser jsonParser,
Map<Class<?>,Unmarshaller<?,JsonUnmarshallerContext>> mapper,
Map<JsonUnmarshallerContext.UnmarshallerType,Unmarshaller<?,JsonUnmarshallerContext>> customUnmarshallerMap,
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.Returns null by default.
|
com.fasterxml.jackson.core.JsonToken |
getCurrentToken()
Returns the current JsonToken that is to be parsed by the parser.
|
String |
getHeader(String header)
Returns the value of the header with the specified name from the
response, or null if not present.
|
HttpResponse |
getHttpResponse()
Returns the original HttpResponse constructed for this request.
|
com.fasterxml.jackson.core.JsonParser |
getJsonParser()
Returns the JsonParser used for parsing the Json document.
|
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.
|
<T> Unmarshaller<T,JsonUnmarshallerContext> |
getUnmarshaller(Class<T> type)
Returns the JsonUnmarshaller for the specified scalar type.
|
<T> Unmarshaller<T,JsonUnmarshallerContext> |
getUnmarshaller(Class<T> type,
JsonUnmarshallerContext.UnmarshallerType unmarshallerType)
Returns the JsonUnmarshaller for requested custom unmarshaller type.
|
boolean |
isInsideResponseHeader()
Returns true if the
JsonUnmarshallerContext is involved in
parsing response headers. |
boolean |
isStartOfDocument()
Returns true if parsing of the Json document is yet to start.
|
com.fasterxml.jackson.core.JsonToken |
nextToken()
Returns the next JsonToken from the JsonParser.
|
com.fasterxml.jackson.core.JsonToken |
peek()
Returns the JsonToken which is to be parsed next.
|
String |
readText()
Returns the text of the current token, or throws an exception if the
current token does not contain text (ex: '{', '}', etc.).
|
void |
setCurrentHeader(String currentHeader)
Sets the name of the response header that is to be read next.
|
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() |
registerMetadataExpression
public JsonUnmarshallerContextImpl(com.fasterxml.jackson.core.JsonParser jsonParser, Map<Class<?>,Unmarshaller<?,JsonUnmarshallerContext>> mapper, HttpResponse httpResponse)
public JsonUnmarshallerContextImpl(com.fasterxml.jackson.core.JsonParser jsonParser, Map<Class<?>,Unmarshaller<?,JsonUnmarshallerContext>> mapper, Map<JsonUnmarshallerContext.UnmarshallerType,Unmarshaller<?,JsonUnmarshallerContext>> customUnmarshallerMap, HttpResponse httpResponse)
public String getHeader(String header)
JsonUnmarshallerContext
getHeader
in class JsonUnmarshallerContext
header
- The name of the header to lookup.public HttpResponse getHttpResponse()
JsonUnmarshallerContext
getHttpResponse
in class JsonUnmarshallerContext
public int getCurrentDepth()
JsonUnmarshallerContext
getCurrentDepth
in class JsonUnmarshallerContext
public String readText() throws IOException
JsonUnmarshallerContext
readText
in class JsonUnmarshallerContext
IOException
public boolean isInsideResponseHeader()
JsonUnmarshallerContext
JsonUnmarshallerContext
is involved in
parsing response headers. Else returns false. Returns true by default.isInsideResponseHeader
in class JsonUnmarshallerContext
public boolean isStartOfDocument()
JsonUnmarshallerContext
isStartOfDocument
in class JsonUnmarshallerContext
public boolean testExpression(String expression)
JsonUnmarshallerContext
testExpression
in class JsonUnmarshallerContext
expression
- The field name to test.public String getCurrentParentElement()
JsonUnmarshallerContext
getCurrentParentElement
in class JsonUnmarshallerContext
public boolean testExpression(String expression, int stackDepth)
JsonUnmarshallerContext
testExpression
in class JsonUnmarshallerContext
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
JsonUnmarshallerContext
nextToken
in class JsonUnmarshallerContext
IOException
public com.fasterxml.jackson.core.JsonToken peek() throws IOException
JsonUnmarshallerContext
peek
in class JsonUnmarshallerContext
IOException
public com.fasterxml.jackson.core.JsonParser getJsonParser()
JsonUnmarshallerContext
getJsonParser
in class JsonUnmarshallerContext
public Map<String,String> getMetadata()
JsonUnmarshallerContext
getMetadata
in class JsonUnmarshallerContext
public void setCurrentHeader(String currentHeader)
JsonUnmarshallerContext
setCurrentHeader
in class JsonUnmarshallerContext
public <T> Unmarshaller<T,JsonUnmarshallerContext> getUnmarshaller(Class<T> type)
JsonUnmarshallerContext
getUnmarshaller
in class JsonUnmarshallerContext
public <T> Unmarshaller<T,JsonUnmarshallerContext> getUnmarshaller(Class<T> type, JsonUnmarshallerContext.UnmarshallerType unmarshallerType)
JsonUnmarshallerContext
getUnmarshaller
in class JsonUnmarshallerContext
public com.fasterxml.jackson.core.JsonToken getCurrentToken()
JsonUnmarshallerContext
getCurrentToken
in class JsonUnmarshallerContext
public String getLastParsedParentElement()
JsonUnmarshallerContext
getLastParsedParentElement
in class JsonUnmarshallerContext
Copyright © 2022. All rights reserved.