public class DefaultBoxJSONResponseParser extends Object implements IBoxResponseParser
| Constructor and Description |
|---|
DefaultBoxJSONResponseParser(Class objectClass,
IBoxJSONParser parser)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Class |
getObjectClass()
Class of the wrapped object.
|
IBoxJSONParser |
getParser() |
Object |
parse(IBoxResponse response)
By default, this only parses the JSON part into object.
|
protected Object |
parseInputStream(InputStream in)
Parse input stream.
|
public DefaultBoxJSONResponseParser(Class objectClass, IBoxJSONParser parser)
objectClass - class of the wrapped object. Response from API will be parsed into this object, caller needs to make sure this class has fields with same
names as the JSON part of API response. If class contains more fields than the JSON, those fields will be left null. If the class contains
less fields than the JSON, the parsing will error out.objectMapper - ObjectMapper to be used when parsing.public IBoxJSONParser getParser()
public Class getObjectClass()
public Object parse(IBoxResponse response) throws BoxRestException
parse in interface IBoxResponseParserresponse - API response.BoxRestExceptionprotected Object parseInputStream(InputStream in) throws BoxRestException, BoxJSONException
in - input stream.BoxRestExceptionBoxJSONExceptionCopyright © 2014. All Rights Reserved.