Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.Module


     * @see #addAdapter(String, Class, Object)
     */
    @Override
    public JsonService addAdapter(String name, Class target, Class mixin)
            throws Exception {
        Module mx = new MixinModule(name, target, mixin);
        getLogger().debug("registering unversioned simple mixin module named " + name + " of type " + mixin + "  for: " + target);
        mapper.registerModule(mx);
        return this;
    }
View Full Code Here


    @Override
    public JsonService addAdapter(String name, Class target, Object module)
            throws Exception {
        if (module instanceof CustomModuleWrapper) {
            CustomModuleWrapper cmw = (CustomModuleWrapper) module;
            Module cm = new CustomModule(name, target, cmw.getSer(),
                    cmw.getDeSer());
            getLogger().debug("registering custom module " + cm + "  for: " + target);
            mapper.registerModule(cm);
        } else if (module instanceof Module) {
            getLogger().debug(
View Full Code Here

    }

    @SuppressWarnings("rawtypes")
    public String withMixinModule(Object src, String name, Class target,
            Class mixin) throws JsonProcessingException {
        Module mx = new MixinModule(name, target, mixin);
        getLogger().debug("registering module " + mx + "  for: " + mixin);
        return mapper.registerModule(mx).writer().writeValueAsString(src);
    }
View Full Code Here

   
    public OTPHttpHandler (Graph graph) {
        this.graph = graph;
        handlers.put("routes", new RoutesHandler());
        handlers.put("plan",   new PlanHandler());
        Module module = AgencyAndIdSerializer.makeModule();
        xmlMapper.registerModule(module);
        jsonMapper.registerModule(module);
    }
View Full Code Here

public class GlobalSettingParser {
    private CollectionReader reader = new CollectionReader();

    public GlobalSettingParser() {
        Module textContainerModule = new SimpleModule("TextContainerModule",
                new Version(1, 0, 0, null, null, null))
                .addDeserializer(TextContainer.class, new TextContainerDeserializer());
        this.reader = new CollectionReader(textContainerModule);
    }
View Full Code Here

    protected static Logger logger = LoggerFactory.getLogger(HttpServer.class);
    protected final CollectionReader reader;

    protected BaseParser() {
        Module textContainerModule = new SimpleModule("TextContainerModule",
                new Version(1, 0, 0, null, null, null))
                .addDeserializer(TextContainer.class, new TextContainerDeserializer());
        Module proxyContainerModule = new SimpleModule("ProxyContainerModule",
                new Version(1, 0, 0, null, null, null))
                .addDeserializer(ProxyContainer.class, new ProxyContainerDeserializer());
        this.reader = new CollectionReader(textContainerModule, proxyContainerModule);
    }
View Full Code Here

TOP

Related Classes of com.fasterxml.jackson.databind.Module

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.