Examples of AnnotationIntrospector


Examples of com.facebook.presto.hive.shaded.org.codehaus.jackson.map.AnnotationIntrospector

            if (name != null) {
                return name;
            }
        }
        BasicBeanDescription beanDesc = (BasicBeanDescription) config.introspectClassAnnotations(rootType);
        AnnotationIntrospector intr = config.getAnnotationIntrospector();
        AnnotatedClass ac = beanDesc.getClassInfo();
        String nameStr = intr.findRootName(ac);
        // No answer so far? Let's just default to using simple class name
        if (nameStr == null) {
            // Should we strip out enclosing class tho? For now, nope:
            nameStr = rootType.getSimpleName();
        }
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.AnnotationIntrospector

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

Examples of com.facebook.presto.jdbc.internal.jackson.databind.AnnotationIntrospector

   
    protected POJOPropertiesCollector collectPropertiesWithBuilder(MapperConfig<?> config,
            JavaType type, MixInResolver r, boolean forSerialization)
    {
        boolean useAnnotations = config.isAnnotationProcessingEnabled();
        AnnotationIntrospector ai = useAnnotations ? config.getAnnotationIntrospector() : null;
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), ai, r);
        JsonPOJOBuilder.Value builderConfig = (ai == null) ? null : ai.findPOJOBuilderConfig(ac);
        String mutatorPrefix = (builderConfig == null) ? "with" : builderConfig.withPrefix;
        return constructPropertyCollector(config, ac, type, forSerialization, mutatorPrefix).collect();
    }
View Full Code Here

Examples of com.facebook.presto.jdbc.internal.jackson.databind.AnnotationIntrospector

     */
    protected boolean hasContentTypeAnnotation(SerializerProvider provider,
            BeanProperty property)
    {
        if (property != null) {
            AnnotationIntrospector intr = provider.getAnnotationIntrospector();
            if (intr != null) {
                if (intr.findSerializationContentType(property.getMember(), property.getType()) != null) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here

Examples of com.fasterxml.jackson.databind.AnnotationIntrospector

        }
    }

    private static ObjectMapper getMapper() {
        ObjectMapper jacksonMapper = new ObjectMapper();
        AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
        jacksonMapper.setAnnotationIntrospector(primary);
        jacksonMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
        jacksonMapper.registerModule(new MrBeanModule());
        return jacksonMapper;
    }
View Full Code Here

Examples of com.fasterxml.jackson.databind.AnnotationIntrospector

  /**
   * Annotation introspector to use for serialization process
   * is configured separately for serialization and deserialization purposes
   */
  public JaxbJacksonObjectMapper() {
      final AnnotationIntrospector introspector
          = new JacksonAnnotationIntrospector();
      super.getDeserializationConfig()
           .with(introspector);
      super.getSerializationConfig()
           .with(introspector);
View Full Code Here

Examples of com.fasterxml.jackson.databind.AnnotationIntrospector

        String json = ResourceUtils.find(contextClass, resourceName);
        if (json != null) {
          ObjectMapper mapper = new ObjectMapper();

          // Use JAXB annotations
          AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
          mapper = mapper.setAnnotationIntrospector(introspector);

          mapper = mapper.configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true);
          mapper = mapper.configure(JsonParser.Feature.ALLOW_UNQUOTED_FIELD_NAMES, true);
          mapper = mapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
View Full Code Here

Examples of com.fasterxml.jackson.databind.AnnotationIntrospector

    if (formatted) {
      mapper.enable(SerializationFeature.INDENT_OUTPUT);
    }

    // Favor JAXB annotations
    AnnotationIntrospector jaxbIntrospector = new JaxbAnnotationIntrospector(typeFactory);
    AnnotationIntrospector jacksonIntrospector = new JacksonAnnotationIntrospector();
    AnnotationIntrospector introspector = new AnnotationIntrospectorPair(jaxbIntrospector, jacksonIntrospector);
    mapper.setAnnotationIntrospector(introspector);

    return mapper;

  }
View Full Code Here

Examples of com.fasterxml.jackson.databind.AnnotationIntrospector

            getLogger().info(
                    "using default introspector:"
                            + primary.getClass().getName());
            mapper.setAnnotationIntrospector(primary);
        } else if (primary != null && secondary != null){
            AnnotationIntrospector pair = new AnnotationIntrospectorPair(
                    primary, secondary);
            mapper.setAnnotationIntrospector(pair);
        } else {
            mapper.setAnnotationIntrospector(primary);
        }
View Full Code Here

Examples of com.fasterxml.jackson.databind.AnnotationIntrospector

        return result;
    }

    private static AnnotationIntrospector createJaxbJacksonAnnotationIntrospector() {

        final AnnotationIntrospector jaxbIntrospector = new JaxbAnnotationIntrospector(TypeFactory.defaultInstance());
        final AnnotationIntrospector jacksonIntrospector = new JacksonAnnotationIntrospector();

        return 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.