*
* @author Kai Moritz
*/
-@org.codehaus.jackson.map.annotate.JsonSerialize(using = GraphApiExceptionJackson1Serializer.class)
@org.codehaus.jackson.map.annotate.JsonDeserialize(using = GraphApiExceptionJackson1Deserializer.class)
-@com.fasterxml.jackson.databind.annotation.JsonSerialize(using = GraphApiExceptionJackson2Serializer.class)
@com.fasterxml.jackson.databind.annotation.JsonDeserialize(using = GraphApiExceptionJackson2Deserializer.class)
public class GraphApiException extends OAuth2Exception
{
+++ /dev/null
-package de.juplo.facebook;
-
-import java.io.IOException;
-import java.util.Map.Entry;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
-import org.codehaus.jackson.map.JsonSerializer;
-import org.codehaus.jackson.map.SerializerProvider;
-
-/**
- * @author Dave Syer
- *
- */
-public class GraphApiExceptionJackson1Serializer extends JsonSerializer<GraphApiException> {
-
- @Override
- public void serialize(GraphApiException value, JsonGenerator jgen, SerializerProvider provider) throws IOException,
- JsonProcessingException {
- jgen.writeStartObject();
- jgen.writeStringField("error", value.getOAuth2ErrorCode());
- jgen.writeStringField("error_description", value.getMessage());
- if (value.getAdditionalInformation()!=null) {
- for (Entry<String, String> entry : value.getAdditionalInformation().entrySet()) {
- String key = entry.getKey();
- String add = entry.getValue();
- jgen.writeStringField(key, add);
- }
- }
- jgen.writeEndObject();
- }
-
-}
+++ /dev/null
-package de.juplo.facebook;
-
-import java.io.IOException;
-import java.util.Map.Entry;
-
-import com.fasterxml.jackson.core.JsonGenerator;
-import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.databind.SerializerProvider;
-import com.fasterxml.jackson.databind.ser.std.StdSerializer;
-
-/**
- * @author Brian Clozel
- *
- */
-public class GraphApiExceptionJackson2Serializer extends StdSerializer<GraphApiException> {
-
- public GraphApiExceptionJackson2Serializer() {
- super(GraphApiException.class);
- }
-
- @Override
- public void serialize(GraphApiException value, JsonGenerator jgen, SerializerProvider provider) throws IOException,
- JsonProcessingException {
- jgen.writeStartObject();
- jgen.writeStringField("error", value.getOAuth2ErrorCode());
- jgen.writeStringField("error_description", value.getMessage());
- if (value.getAdditionalInformation()!=null) {
- for (Entry<String, String> entry : value.getAdditionalInformation().entrySet()) {
- String key = entry.getKey();
- String add = entry.getValue();
- jgen.writeStringField(key, add);
- }
- }
- jgen.writeEndObject();
- }
-
-}