Examples of AnnotationIntrospector


Examples of org.codehaus.jackson.map.AnnotationIntrospector

    }

    private ObjectMapper getObjectMapper() throws IOException {
        if (this.objectMapper == null) {
            ObjectMapper objectMapper = new ObjectMapper();
            AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
            SerializationConfig serializationConfig = objectMapper.getSerializationConfig();
            serializationConfig = serializationConfig.without(SerializationConfig.Feature.WRAP_ROOT_VALUE)
                                                     .withAnnotationIntrospector(introspector);
            objectMapper.setSerializationConfig(serializationConfig);
            this.objectMapper = objectMapper;
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    }

    private ObjectMapper getObjectMapper() throws IOException {
        if (this.objectMapper == null) {
            ObjectMapper objectMapper = new ObjectMapper();
            AnnotationIntrospector introspector = new JaxbAnnotationIntrospector();
            SerializationConfig serializationConfig = objectMapper.getSerializationConfig();
            serializationConfig = serializationConfig.without(SerializationConfig.Feature.WRAP_ROOT_VALUE)
                    .with(SerializationConfig.Feature.INDENT_OUTPUT)
                    .withSerializationInclusion(JsonSerialize.Inclusion.NON_NULL)
                    .withSerializationInclusion(JsonSerialize.Inclusion.NON_EMPTY)
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

            getLogger().info(
                    "using default introspector:"
                            + primary.getClass().getName());
            mapper.setAnnotationIntrospector(primary);
        } else {
            AnnotationIntrospector pair = new AnnotationIntrospector.Pair(
                    primary, secondary);
            mapper.setAnnotationIntrospector(pair);
        }

        // mapper.enableDefaultTypingAsProperty(DefaultTyping.OBJECT_AND_NON_CONCRETE,
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

*
*/
public class JacksonHelper {
    public static ObjectMapper createObjectMapper() {
        ObjectMapper mapper = new ObjectMapper();
        AnnotationIntrospector primary = new JaxbAnnotationIntrospector();
        AnnotationIntrospector secondary = new JacksonAnnotationIntrospector();
        AnnotationIntrospector pair = new AnnotationIntrospector.Pair(primary, secondary);
        mapper.getDeserializationConfig().setAnnotationIntrospector(pair);
        // [rfeng] To avoid complaints about javaClass
        mapper.getDeserializationConfig().set(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
        mapper.getSerializationConfig().setAnnotationIntrospector(pair);
        return mapper;
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

    @Override
    public BasicBeanDescription forSerialization(SerializationConfig cfg,
            JavaType type, MixInResolver r)
    {
        AnnotationIntrospector ai = cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), ai, 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)
    {
        AnnotationIntrospector ai = cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), ai, 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)
    {
        AnnotationIntrospector ai = cfg.getAnnotationIntrospector();
        AnnotatedClass ac = AnnotatedClass.construct(type.getRawClass(), ai, r);
        ac.resolveCreators(true);
        return new BasicBeanDescription(type, ac, ai);
    }
View Full Code Here

Examples of org.codehaus.jackson.map.AnnotationIntrospector

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

Examples of org.codehaus.jackson.map.AnnotationIntrospector

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

Examples of org.eclipse.jetty.annotations.AnnotationIntrospector

    throws Exception
    {
        new org.eclipse.jetty.plus.jndi.EnvEntry(server, "resA", objA, false);
        new org.eclipse.jetty.plus.jndi.EnvEntry(server, "resB", objB, false);

        AnnotationIntrospector parser = new AnnotationIntrospector();
        ResourceAnnotationHandler handler = new ResourceAnnotationHandler(wac);
        parser.registerHandler(handler);
        parser.introspect(ResourceA.class);
        parser.introspect(ResourceB.class);

        //processing classA should give us these jndi name bindings:
        // java:comp/env/myf
        // java:comp/env/org.eclipse.jetty.annotations.resources.ResourceA/g
        // java:comp/env/mye
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.