Examples of addMixInAnnotations()


Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

      if (outputConfig.getOutputFormat() == OutputFormat.EXTJS5) {
        mapper.addMixInAnnotations(ProxyObject.class,
            ProxyObjectWithoutApiQuotesExtJs5Mixin.class);
      }
      else {
        mapper.addMixInAnnotations(ProxyObject.class,
            ProxyObjectWithoutApiQuotesMixin.class);
      }
      mapper.addMixInAnnotations(ApiObject.class, ApiObjectMixin.class);
    }
    else {
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

      }
      else {
        mapper.addMixInAnnotations(ProxyObject.class,
            ProxyObjectWithoutApiQuotesMixin.class);
      }
      mapper.addMixInAnnotations(ApiObject.class, ApiObjectMixin.class);
    }
    else {
      if (outputConfig.getOutputFormat() != OutputFormat.EXTJS5) {
        mapper.addMixInAnnotations(ProxyObject.class,
            ProxyObjectWithApiQuotesMixin.class);
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

      }
      mapper.addMixInAnnotations(ApiObject.class, ApiObjectMixin.class);
    }
    else {
      if (outputConfig.getOutputFormat() != OutputFormat.EXTJS5) {
        mapper.addMixInAnnotations(ProxyObject.class,
            ProxyObjectWithApiQuotesMixin.class);
      }
    }

    Map<String, Object> modelObject = new LinkedHashMap<String, Object>();
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

        mapper.setVisibility(PropertyAccessor.GETTER, Visibility.NONE);
        mapper.setVisibility(PropertyAccessor.IS_GETTER, Visibility.NONE);
        mapper.setVisibility(PropertyAccessor.SETTER, Visibility.NONE);
        mapper.setVisibility(PropertyAccessor.CREATOR, Visibility.NONE);
       
        mapper.addMixInAnnotations(Object.class, IgnoreTypeMixIn.class);
       
        final FilterProvider filters = new SimpleFilterProvider().addFilter("storedDataFilter", SimpleBeanPropertyFilter.serializeAllExcept("storedData"));

        final ObjectWriter ssWriter = mapper.writer(filters);
        final ObjectReader ssReader = mapper.reader(sus.getClass());
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

    @Test
    public void testMixinNoCopy() throws Exception {
        ObjectMapper mapper = new ObjectMapper();
        mapper.findAndRegisterModules();
       
        mapper.addMixInAnnotations(Object.class, PortletRenderExecutionEventFilterMixIn.class);
        final FilterProvider filterProvider = new SimpleFilterProvider().addFilter(PortletRenderExecutionEventFilterMixIn.FILTER_NAME, SimpleBeanPropertyFilter.filterOutAllExcept("fname", "executionTimeNano", "parameters"));
        final ObjectWriter portletEventWriter = mapper.writer(filterProvider);
       
        final String result = portletEventWriter.writeValueAsString(createEvent());
       
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

        mapper.findAndRegisterModules();
       
        //Clone from "shared" ObjectMapper
        mapper = mapper.copy();
       
        mapper.addMixInAnnotations(Object.class, PortletRenderExecutionEventFilterMixIn.class);
        final FilterProvider filterProvider = new SimpleFilterProvider().addFilter(PortletRenderExecutionEventFilterMixIn.FILTER_NAME, SimpleBeanPropertyFilter.filterOutAllExcept("fname", "executionTimeNano", "parameters"));
        final ObjectWriter portletEventWriter = mapper.writer(filterProvider);
       
        final String result = portletEventWriter.writeValueAsString(createEvent());
       
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

    String jsonConfig;
    if (!doc) {
      jsonConfig = configurationService.getJsonHandler().writeValueAsString(remotingApi, debug);
    } else {
      ObjectMapper mapper = new ObjectMapper();
      mapper.addMixInAnnotations(RemotingApi.class, RemotingApiMixin.class);
      try {
        jsonConfig = mapper.writer().withDefaultPrettyPrinter().writeValueAsString(remotingApi);
      } catch (JsonProcessingException e) {
        jsonConfig = null;
        LogFactory.getLog(ApiController.class).info("serialize object to json", e);
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

            final MappingJackson2HttpMessageConverter converter = (MappingJackson2HttpMessageConverter) httpMessageConverter;

            final ObjectMapper objectMapper = converter.getObjectMapper();
            objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
            objectMapper.setDateFormat(new ISO8601DateFormatWithMilliSeconds());
            objectMapper.addMixInAnnotations(StepExecution.class, StepExecutionJacksonMixIn.class);
            objectMapper.addMixInAnnotations(ExecutionContext.class, ExecutionContextJacksonMixIn.class);
          }
        }

        converters.add(new ResourceHttpMessageConverter());
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

            final ObjectMapper objectMapper = converter.getObjectMapper();
            objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
            objectMapper.setDateFormat(new ISO8601DateFormatWithMilliSeconds());
            objectMapper.addMixInAnnotations(StepExecution.class, StepExecutionJacksonMixIn.class);
            objectMapper.addMixInAnnotations(ExecutionContext.class, ExecutionContextJacksonMixIn.class);
          }
        }

        converters.add(new ResourceHttpMessageConverter());
      }
View Full Code Here

Examples of com.fasterxml.jackson.databind.ObjectMapper.addMixInAnnotations()

        // default format is that of JSON array...
        assertEquals("[2001,5,25,10,15,30,37]", MAPPER.writeValueAsString(date));
        // but we can force it to be a String as well (note: here we assume this is
        // dynamically changeable)
        ObjectMapper mapper = jodaMapper();
        mapper.addMixInAnnotations(LocalDateTime.class, ObjectConfiguration.class);
        mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);       
        assertEquals("[\"org.joda.time.LocalDateTime\",\"2001-05-25T10:15:30.037\"]", mapper.writeValueAsString(date));
    }

    /*
 
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.