Class TwitterResponseStatusCodeTranslator

  extended by
All Implemented Interfaces:

public class TwitterResponseStatusCodeTranslator
extends java.lang.Object
implements ResponseStatusCodeTranslator

Implementation of ResponseStatusCodeTranslator that reads a Twitter error response and translates it into a specific subclass of SocialException. Per, when Twitter responds with an error, the response will be a hash with two entries: request and error. These entries, along with the HTTP status code, can be used to determine the nature of an error and enable TwitterTemplate to throw a meaningful exception.

Constructor Summary
Method Summary
 SocialException translate(ResponseEntity<?> responseEntity)
          Translate responseEntity into a SocialException
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public TwitterResponseStatusCodeTranslator()
Method Detail


public SocialException translate(ResponseEntity<?> responseEntity)
Description copied from interface: ResponseStatusCodeTranslator
Translate responseEntity into a SocialException

Specified by:
translate in interface ResponseStatusCodeTranslator
responseEntity - The response from the social network provider
the exception translated from the response or null if the response doesn't translate into an error.