diff options
author | Anton Tananaev <anton@traccar.org> | 2022-09-21 21:47:45 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-09-21 21:47:45 -0700 |
commit | abb26e80a5617424d960a0f7d0b98fcb379a5224 (patch) | |
tree | a21f23375279d9ae84a18dc7d6a2991feca2ef64 /src/main/java/org/traccar/helper | |
parent | 13b065fc4e8e1a4dc1f35312869151418fc660bd (diff) | |
download | trackermap-server-abb26e80a5617424d960a0f7d0b98fcb379a5224.tar.gz trackermap-server-abb26e80a5617424d960a0f7d0b98fcb379a5224.tar.bz2 trackermap-server-abb26e80a5617424d960a0f7d0b98fcb379a5224.zip |
Fix forwarding date format
Diffstat (limited to 'src/main/java/org/traccar/helper')
-rw-r--r-- | src/main/java/org/traccar/helper/ObjectMapperContextResolver.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/helper/ObjectMapperContextResolver.java b/src/main/java/org/traccar/helper/ObjectMapperContextResolver.java new file mode 100644 index 000000000..b40e30d76 --- /dev/null +++ b/src/main/java/org/traccar/helper/ObjectMapperContextResolver.java @@ -0,0 +1,38 @@ +/* + * Copyright 2022 Anton Tananaev (anton@traccar.org) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.traccar.helper; + +import com.fasterxml.jackson.databind.ObjectMapper; + +import javax.inject.Inject; +import javax.ws.rs.ext.ContextResolver; + +// This does not work as a lambda +public class ObjectMapperContextResolver implements ContextResolver<ObjectMapper> { + + private final ObjectMapper objectMapper; + + @Inject + public ObjectMapperContextResolver(ObjectMapper objectMapper) { + this.objectMapper = objectMapper; + } + + @Override + public ObjectMapper getContext(Class<?> clazz) { + return objectMapper; + } + +} |