Examples of SimpleModule


Examples of org.codehaus.jackson.map.module.SimpleModule

    // for [JACKSON-670]
    public void testEmptyBean() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        mapper.registerModule(new SimpleModule("test", Version.unknownVersion()) {
            @Override
            public void setupModule(SetupContext context)
            {
                super.setupModule(context);
                context.addBeanSerializerModifier(new EmptyBeanModifier());
View Full Code Here

Examples of org.codehaus.jackson.map.module.SimpleModule

    // Test for [JACKSON-643]
    public void testCustomRootNulls() throws Exception
    {
        ObjectMapper mapper = new ObjectMapper();
        SimpleModule module = new SimpleModule("test", Version.unknownVersion());
        module.addDeserializer(String.class, new FunnyNullDeserializer());
        mapper.registerModule(module);

        // should get non-default null directly:
        String str = mapper.readValue("null", String.class);
        assertNotNull(str);
View Full Code Here

Examples of org.codehaus.jackson.map.module.SimpleModule

            verifyException(e, "missing property");
        }

        // but then succeed when we register default impl
        mapper = new ObjectMapper();
        SimpleModule module = new SimpleModule("test", Version.unknownVersion());
        module.addAbstractTypeMapping(SuperTypeWithoutDefault.class, DefaultImpl505.class);
        mapper.registerModule(module);
        SuperTypeWithoutDefault bean = mapper.readValue(JSON, SuperTypeWithoutDefault.class);
        assertNotNull(bean);
        assertEquals(DefaultImpl505.class, bean.getClass());
        assertEquals(123, ((DefaultImpl505) bean).a);
View Full Code Here

Examples of org.springframework.xd.module.core.SimpleModule

  private void configureModuleConverters(String contentTypeString, Module module, boolean isInput) {
    if (logger.isDebugEnabled()) {
      logger.debug("module " + (isInput ? "input" : "output") + "Type is " + contentTypeString);
    }
    SimpleModule sm = (SimpleModule) module;
    try {
      MimeType contentType = resolveContentType(contentTypeString, module);

      AbstractMessageChannel channel = getChannel(module, isInput);

      CompositeMessageConverter converters = null;
      try {
        converters = converterFactory.newInstance(contentType);
      }
      catch (ConversionException e) {
        throw new ModuleConfigurationException(e.getMessage() +
            "(" +
            module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString
            + ")");
      }

      Class<?> dataType = MessageConverterUtils.getJavaTypeForContentType(contentType,
          sm.getApplicationContext().getClassLoader());
      if (dataType == null) {
        throw new ModuleConfigurationException("Content type is not supported for " +
            module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString);
      }
      else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.