Removed unnecessary classes and code
authorKai Moritz <kai@juplo.de>
Tue, 6 Oct 2015 16:30:51 +0000 (18:30 +0200)
committerKai Moritz <kai@juplo.de>
Sat, 7 Nov 2015 16:48:57 +0000 (17:48 +0100)
src/main/java/de/juplo/facebook/GraphApiException.java
src/main/java/de/juplo/facebook/GraphApiExceptionJackson1Serializer.java [deleted file]
src/main/java/de/juplo/facebook/GraphApiExceptionJackson2Serializer.java [deleted file]

index 47ea6c3..18eaf81 100644 (file)
@@ -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 (file)
index db7497f..0000000
+++ /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<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();
-       }
-
-}
diff --git a/src/main/java/de/juplo/facebook/GraphApiExceptionJackson2Serializer.java b/src/main/java/de/juplo/facebook/GraphApiExceptionJackson2Serializer.java
deleted file mode 100644 (file)
index 23b02d8..0000000
+++ /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<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();
-       }
-
-}