From: Kai Moritz Date: Tue, 6 Oct 2015 16:30:51 +0000 (+0200) Subject: Removed unnecessary classes and code X-Git-Tag: facebook-utils-2.5.0~15 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=80f6b663c648f011425b521e7c4185128a00149d;p=facebook-errors Removed unnecessary classes and code --- diff --git a/src/main/java/de/juplo/facebook/GraphApiException.java b/src/main/java/de/juplo/facebook/GraphApiException.java index 47ea6c3..18eaf81 100644 --- a/src/main/java/de/juplo/facebook/GraphApiException.java +++ b/src/main/java/de/juplo/facebook/GraphApiException.java @@ -7,9 +7,7 @@ import org.springframework.security.oauth2.common.exceptions.OAuth2Exception; * * @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 { diff --git a/src/main/java/de/juplo/facebook/GraphApiExceptionJackson1Serializer.java b/src/main/java/de/juplo/facebook/GraphApiExceptionJackson1Serializer.java deleted file mode 100644 index db7497f..0000000 --- a/src/main/java/de/juplo/facebook/GraphApiExceptionJackson1Serializer.java +++ /dev/null @@ -1,32 +0,0 @@ -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 { - - @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 entry : value.getAdditionalInformation().entrySet()) { - String key = entry.getKey(); - String add = entry.getValue(); - jgen.writeStringField(key, add); - } - } - jgen.writeEndObject(); - } - -} diff --git a/src/main/java/de/juplo/facebook/GraphApiExceptionJackson2Serializer.java b/src/main/java/de/juplo/facebook/GraphApiExceptionJackson2Serializer.java deleted file mode 100644 index 23b02d8..0000000 --- a/src/main/java/de/juplo/facebook/GraphApiExceptionJackson2Serializer.java +++ /dev/null @@ -1,37 +0,0 @@ -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 { - - 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 entry : value.getAdditionalInformation().entrySet()) { - String key = entry.getKey(); - String add = entry.getValue(); - jgen.writeStringField(key, add); - } - } - jgen.writeEndObject(); - } - -}