    001// Licensed to the Apache Software Foundation (ASF) under one
    002// or more contributor license agreements.  See the NOTICE file
    003// distributed with this work for additional information
    004// regarding copyright ownership.  The ASF licenses this file
    005// to you under the Apache License, Version 2.0 (the
    006// "License"); you may not use this file except in compliance
    007// with the License.  You may obtain a copy of the License at
    008//
    009// http://www.apache.org/licenses/LICENSE-2.0
    010//
    011// Unless required by applicable law or agreed to in writing,
    012// software distributed under the License is distributed on an
    013// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    014// KIND, either express or implied.  See the License for the
    015// specific language governing permissions and limitations
    016// under the License.
    017package org.apache.tapestry5.rest.jackson.internal;
    018
    019import org.apache.tapestry5.jacksondatabind.services.ObjectMapperSource;
    020
    021import com.fasterxml.jackson.databind.ObjectMapper;
    022
    023/**
    024 * {@link ObjectMapperSource} implementation that always returns the
    025 * same object returned by instantiating {@link ObjectMapper}.
    026 * @since 5.8.0
    027 */
    028public final class FallbackObjectMapperSource implements ObjectMapperSource
    029{
    030
    031    private final ObjectMapper objectMapper = new ObjectMapper();
    032
    033    @Override
    034    public ObjectMapper get(Class<?> clasz)
    035    {
    036        return objectMapper;
    037    }
    038
    039}