public class JsonUnmarshallerContextImpl extends JsonUnmarshallerContext
JsonUnmarshallerContext.UnmarshallerType| Constructor and Description |
|---|
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() |
registerMetadataExpressionpublic 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)
JsonUnmarshallerContextgetHeader in class JsonUnmarshallerContextheader - The name of the header to lookup.public HttpResponse getHttpResponse()
JsonUnmarshallerContextgetHttpResponse in class JsonUnmarshallerContextpublic int getCurrentDepth()
JsonUnmarshallerContextgetCurrentDepth in class JsonUnmarshallerContextpublic String readText() throws IOException
JsonUnmarshallerContextreadText in class JsonUnmarshallerContextIOExceptionpublic boolean isInsideResponseHeader()
JsonUnmarshallerContextJsonUnmarshallerContext is involved in
parsing response headers. Else returns false. Returns true by default.isInsideResponseHeader in class JsonUnmarshallerContextpublic boolean isStartOfDocument()
JsonUnmarshallerContextisStartOfDocument in class JsonUnmarshallerContextpublic boolean testExpression(String expression)
JsonUnmarshallerContexttestExpression in class JsonUnmarshallerContextexpression - The field name to test.public String getCurrentParentElement()
JsonUnmarshallerContextgetCurrentParentElement in class JsonUnmarshallerContextpublic boolean testExpression(String expression, int stackDepth)
JsonUnmarshallerContexttestExpression in class JsonUnmarshallerContextexpression - 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
JsonUnmarshallerContextnextToken in class JsonUnmarshallerContextIOExceptionpublic com.fasterxml.jackson.core.JsonToken peek()
throws IOException
JsonUnmarshallerContextpeek in class JsonUnmarshallerContextIOExceptionpublic com.fasterxml.jackson.core.JsonParser getJsonParser()
JsonUnmarshallerContextgetJsonParser in class JsonUnmarshallerContextpublic Map<String,String> getMetadata()
JsonUnmarshallerContextgetMetadata in class JsonUnmarshallerContextpublic void setCurrentHeader(String currentHeader)
JsonUnmarshallerContextsetCurrentHeader in class JsonUnmarshallerContextpublic <T> Unmarshaller<T,JsonUnmarshallerContext> getUnmarshaller(Class<T> type)
JsonUnmarshallerContextgetUnmarshaller in class JsonUnmarshallerContextpublic <T> Unmarshaller<T,JsonUnmarshallerContext> getUnmarshaller(Class<T> type, JsonUnmarshallerContext.UnmarshallerType unmarshallerType)
JsonUnmarshallerContextgetUnmarshaller in class JsonUnmarshallerContextpublic com.fasterxml.jackson.core.JsonToken getCurrentToken()
JsonUnmarshallerContextgetCurrentToken in class JsonUnmarshallerContextpublic String getLastParsedParentElement()
JsonUnmarshallerContextgetLastParsedParentElement in class JsonUnmarshallerContextCopyright © 2017. All rights reserved.