com.restfb
Interface DefaultJsonMapper.JsonMappingErrorHandler

Enclosing class:
DefaultJsonMapper

public static interface DefaultJsonMapper.JsonMappingErrorHandler

Callback interface which allows client code to specify how JSON mapping errors should be handled.

Since:
1.6.2
Author:
Mark Allen

Method Summary
 boolean handleMappingError(String unmappableJson, Class<?> targetType, Exception e)
          This method will be called by DefaultJsonMapper if it encounters an error while attempting to map JSON to a Java object.
 

Method Detail

handleMappingError

boolean handleMappingError(String unmappableJson,
                           Class<?> targetType,
                           Exception e)
This method will be called by DefaultJsonMapper if it encounters an error while attempting to map JSON to a Java object.

You may perform any behavior you'd like here in response to an error, e.g. logging it.

If the mapper should continue processing, return true and null will be mapped to the target type. If you would like the mapper to stop processing and throw FacebookJsonMappingException, return false.

Parameters:
unmappableJson - The JSON that couldn't be mapped to a Java type.
targetType - The Java type we were attempting to map to.
e - The exception that occurred while performing the mapping operation, or null if there was no exception.
Returns:
true to continue processing, false to throw a FacebookJsonMappingException.


RestFB 1.6.8. Copyright © 2010-2011 Mark Allen. All Rights Reserved.