com.jk.services.server.JKJerseyObjectMapperProvider Maven / Gradle / Ivy
/*
* Copyright 2002-2023 Dr. Jalal Kiswani.
* Email: [email protected]
* Check out https://j-framework.com for more details
*
* All the opensource projects of Dr. Jalal Kiswani are free for personal and academic use only,
* for commercial usage and support, please contact the author.
*
* 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 com.jk.services.server;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.jk.core.util.JKObjectUtil;
import jakarta.ws.rs.ext.ContextResolver;
/**
* This class provides a custom configuration for the Jackson ObjectMapper.
*
* This class implements the {@link ContextResolver} interface.
*
* @author Dr. Jalal H. Kiswani
* @version 1.0
*/
public class JKJerseyObjectMapperProvider implements ContextResolver {
/**
* {@inheritDoc}
*/
@Override
public ObjectMapper getContext(Class> type) {
// ObjectMapper result = new ObjectMapper();
// result.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
// result.configure(SerializationFeature.INDENT_OUTPUT,true);
//
// return result;
return JKObjectUtil.createMapper();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy