File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
src/main/resources/handlebars/JavaJaxRS/resteasy Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,15 @@ import com.fasterxml.jackson.core.JsonGenerator;
5
5
import com.fasterxml.jackson.databind.ObjectMapper;
6
6
import com.fasterxml.jackson.databind.SerializerProvider;
7
7
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
8
+ { {#java8} }
9
+ import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
10
+ { {/java8} }
11
+ { {#joda} }
8
12
import com.fasterxml.jackson.datatype.joda.JodaModule;
9
13
import org.joda.time.DateTime;
10
14
import org.joda.time.LocalDate;
11
15
import org.joda.time.format.ISODateTimeFormat;
16
+ { {/joda} }
12
17
13
18
import javax.ws.rs.ext.ContextResolver;
14
19
import javax.ws.rs.ext.Provider;
@@ -22,6 +27,10 @@ public class JacksonConfig implements ContextResolver<ObjectMapper> {
22
27
23
28
objectMapper = new ObjectMapper()
24
29
.setDateFormat(new RFC3339DateFormat())
30
+ {{#java8} }
31
+ .registerModule(new JavaTimeModule());
32
+ { {/java8} }
33
+ { {#joda} }
25
34
.registerModule(new JodaModule() {
26
35
{
27
36
addSerializer(DateTime.class, new StdSerializer< DateTime> (DateTime.class) {
@@ -39,9 +48,10 @@ public class JacksonConfig implements ContextResolver<ObjectMapper> {
39
48
40
49
}
41
50
});
51
+ { {/joda} }
42
52
}
43
53
44
54
public ObjectMapper getContext(Class<?> arg0) {
45
55
return objectMapper;
46
56
}
47
- }
57
+ }
You can’t perform that action at this time.
0 commit comments