Examples of AnnotationIntrospector


Examples of org.codehaus.jackson.map.AnnotationIntrospector

    @Override
    public BasicBeanDescription forSerialization(SerializationConfig cfg,
            JavaType type, MixInResolver r)
    {
        boolean useAnnotations = cfg.isAnnotationProcessingEnabled();
        AnnotationIntrospector ai = cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), (useAnnotations ? ai : null), r);
        // False -> no need to collect ignorable member list
        ac.resolveMemberMethods(getSerializationMethodFilter(cfg), false);
        /* only the default constructor needed here (that's needed
         * in case we need to check default bean property values,
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    @Override
    public BasicBeanDescription forDeserialization(DeserializationConfig cfg,
            JavaType type, MixInResolver r)
    {
        boolean useAnnotations = cfg.isAnnotationProcessingEnabled();
        AnnotationIntrospector ai =  cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), (useAnnotations ? ai : null), r);
        // everything needed for deserialization, including ignored methods
        ac.resolveMemberMethods(getDeserializationMethodFilter(cfg), true);
        // include all kinds of creator methods:
        ac.resolveCreators(true);
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    @Override
    public BasicBeanDescription forCreation(DeserializationConfig cfg,
            JavaType type, MixInResolver r)
    {
        boolean useAnnotations = cfg.isAnnotationProcessingEnabled();
        AnnotationIntrospector ai =  cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), (useAnnotations ? ai : null), r);
        ac.resolveCreators(true);
        return new BasicBeanDescription(cfg, type, ac);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    @Override
    public BasicBeanDescription forClassAnnotations(MapperConfig<?> cfg,
            Class<?> c, MixInResolver r)
    {
        boolean useAnnotations = cfg.isAnnotationProcessingEnabled();
        AnnotationIntrospector ai =  cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(c, (useAnnotations ? ai : null), r);
        return new BasicBeanDescription(cfg, cfg.constructType(c), ac);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    @Override
    public BasicBeanDescription forDirectClassAnnotations(MapperConfig<?> cfg,
            Class<?> c, MixInResolver r)
    {
        boolean useAnnotations = cfg.isAnnotationProcessingEnabled();
        AnnotationIntrospector ai =  cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.constructWithoutSuperTypes(c, (useAnnotations ? ai : null), r);
        return new BasicBeanDescription(cfg, cfg.constructType(c), ac);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

        ObjectMapper mapper = new ObjectMapper();
        mapper.getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL);
        mapper.getDeserializationConfig().set(Feature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
//        mapper.getSerializationConfig().setDateFormat(StdDateFormat.getBlueprintISO8601Format());
//        mapper.getDeserializationConfig().setDateFormat(StdDateFormat.getBlueprintISO8601Format());
        AnnotationIntrospector pair =
            new AnnotationIntrospector.Pair(new JaxbAnnotationIntrospector(),
                                            new JacksonAnnotationIntrospector());
        mapper.getDeserializationConfig().setAnnotationIntrospector(pair);
        mapper.getSerializationConfig().setAnnotationIntrospector(pair);
        return mapper;
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    /**
     * Constructor configuring provider
     */
    public JSONProvider() {
        if (commonMapper == null) {
            AnnotationIntrospector jackson = new JacksonAnnotationIntrospector();
            AnnotationIntrospector jaxb = new JaxbAnnotationIntrospector();
            AnnotationIntrospector pair = new AnnotationIntrospector.Pair(jaxb, jackson);
            ObjectMapper mapper = new ObjectMapper();
            mapper.getSerializationConfig().setAnnotationIntrospector(jaxb);
            mapper.getDeserializationConfig().setAnnotationIntrospector(pair);
            mapper.getDeserializationConfig().set(Feature.AUTO_DETECT_SETTERS, true);
            mapper.configure(Feature.AUTO_DETECT_SETTERS, true);
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

   * @return
   */
  public String getFeeds(ResponsePojo rp) {
    String xml = null;
    XmlMapper mapper = new XmlMapper();
    AnnotationIntrospector ai = new JaxbAnnotationIntrospector();
    // make deserializer use JAXB annotations (only)
    mapper.getDeserializationConfig().setAnnotationIntrospector(ai);
      // make serializer use JAXB annotations (only)
      mapper.getSerializationConfig().setAnnotationIntrospector(ai);
    try {
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

      @Override
      protected ObjectMapper initialValue() {

        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        AnnotationIntrospector introspector = new AnnotationIntrospector.Pair(new JaxbAnnotationIntrospector(),
            new JacksonAnnotationIntrospector());

        SerializationConfig sc = mapper.getSerializationConfig().withSerializationInclusion(
            JsonSerialize.Inclusion.NON_NULL);
        mapper.setSerializationConfig(sc.withAnnotationIntrospector(introspector));
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

        return result;
    }

    private static Pair createJaxbJacksonAnnotationIntrospector() {

        final AnnotationIntrospector jaxbIntrospector = new JaxbAnnotationIntrospector();
        final AnnotationIntrospector jacksonIntrospector = new JacksonAnnotationIntrospector();

        return new AnnotationIntrospector.Pair(jacksonIntrospector, jaxbIntrospector);
    }
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.