import java.util.Map;
import java.util.Spliterator;
import java.util.stream.Stream;
+import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
+import org.springframework.util.Assert;
* @author kai
*/
@Component
-public class SimpleMapperService extends SimpleMapper
+public class SimpleMapperService
+ extends
+ SimpleMapper
+ implements
+ InitializingBean
{
- @Autowired
+ @Autowired(required = false)
private JsonFactory factory;
+ public SimpleMapperService() {}
+
public SimpleMapperService(JsonFactory factory)
{
this.factory = factory;
}
+ @Override
+ public void afterPropertiesSet() throws Exception
+ {
+ Assert.notNull(factory, "The attribute factory must be set!");
+ }
+
+ public JsonFactory getFactory()
+ {
+ return factory;
+ }
+
+
public Spliterator<Object> getArraySpliterator(File file)
throws
IOException