1 package com.fasterxml.jackson.databind.ext;
2
3 import java.nio.file.Path;
4
5 import com.fasterxml.jackson.databind.JsonDeserializer;
6 import com.fasterxml.jackson.databind.JsonSerializer;
7
8 /**
9  * @since 2.10
10  */

11 public class Java7HandlersImpl extends Java7Handlers
12 {
13     private final Class<?> _pathClass;
14     
15     public Java7HandlersImpl() {
16         // 19-Sep-2019, tatu: Important to do this here, because otherwise
17         //    we get [databind#2466]
18         _pathClass = Path.class;
19     }
20     
21     @Override
22     public Class<?> getClassJavaNioFilePath() {
23         return _pathClass;
24     }
25
26     @Override
27     public JsonDeserializer<?> getDeserializerForJavaNioFilePath(Class<?> rawType) {
28         if (rawType == _pathClass) {
29             return new NioPathDeserializer();
30         }
31         return null;
32     }
33
34     @Override
35     public JsonSerializer<?> getSerializerForJavaNioFilePath(Class<?> rawType) {
36         if (_pathClass.isAssignableFrom(rawType)) {
37             return new NioPathSerializer();
38         }
39         return null;
40     }
41 }
42