Added Spring-Autowireing-Annotations to SimpleMapperService
authorKai Moritz <kai@juplo.de>
Thu, 23 Jun 2016 07:04:55 +0000 (09:04 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 23 Jun 2016 08:12:35 +0000 (10:12 +0200)
pom.xml
src/main/java/de/juplo/jackson/SimpleMapperService.java

diff --git a/pom.xml b/pom.xml
index ec1fc3a..f3fbdf4 100644 (file)
--- a/pom.xml
+++ b/pom.xml
       <artifactId>slf4j-api</artifactId>
     </dependency>
 
+    <!-- Needed for the Spring-Annotations -->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+      <optional>true</optional>
+    </dependency>
+
 
     <!-- Testing -->
     <dependency>
index 3c1e197..a08d2f0 100644 (file)
@@ -12,6 +12,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Spliterator;
 import java.util.stream.Stream;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
 
 
 
@@ -19,9 +21,11 @@ import java.util.stream.Stream;
  *
  * @author kai
  */
+@Component
 public class SimpleMapperService extends SimpleMapper
 {
-  private final JsonFactory factory;
+  @Autowired
+  private JsonFactory factory;
 
 
   public SimpleMapperService(JsonFactory factory)