![JAR search and dependency download from the Maven repository](/logo.png)
net.officefloor.web.json.JacksonHttpObjectResponderServiceFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of officejson_default Show documentation
Show all versions of officejson_default Show documentation
OfficeFloor plug-in for Default JSON integration with Web
/*-
* #%L
* JSON default for Web
* %%
* Copyright (C) 2005 - 2020 Daniel Sagenschneider
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
* #L%
*/
package net.officefloor.web.json;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.officefloor.frame.api.source.ServiceContext;
import net.officefloor.web.build.HttpObjectResponderFactory;
import net.officefloor.web.build.HttpObjectResponderServiceFactory;
/**
* Jackson {@link HttpObjectResponderServiceFactory}.
*
* @author Daniel Sagenschneider
*/
public class JacksonHttpObjectResponderServiceFactory implements HttpObjectResponderServiceFactory {
/*
* =============== HttpObjectResponderServiceFactory ==============
*/
@Override
public HttpObjectResponderFactory createService(ServiceContext context) throws Throwable {
// Create the Object Mapper
ObjectMapper mapper = new ObjectMapper();
// Decorate the Object Mapper
for (ObjectMapperResponderDecorator decorator : context
.loadOptionalServices(ObjectMapperResponderDecoratorServiceFactory.class)) {
decorator.decorateObjectMapper(mapper);
}
// Return factory
return new JacksonHttpObjectResponderFactory(mapper);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy