Package org.codehaus.jackson.map.introspect

Examples of org.codehaus.jackson.map.introspect.AnnotatedMethod


        props = filterBeanProperties(config, beanDesc, props);
        // Do they need to be sorted in some special way?
        props = sortBeanProperties(config, beanDesc, props);
        BeanSerializer ser = new BeanSerializer(beanDesc.getBeanClass(), props);
        // 1.6: any-setter?
        AnnotatedMethod m = beanDesc.findAnyGetter();
        if (m != null) {
            JavaType type = m.getType(beanDesc.bindingsForBeanType());
            // copied from BasicSerializerFactory.buildMapSerializer():
            boolean staticTyping = config.isEnabled(SerializationConfig.Feature.USE_STATIC_TYPING);
            JavaType valueType = type.getContentType();
            TypeSerializer typeSer = createTypeSerializer(valueType, config);
            MapSerializer mapSer = MapSerializer.construct(/* ignored props*/ null, type, staticTyping, typeSer);
View Full Code Here


                return buildIndexedListSerializer(type, config, beanDesc);
            }
            return buildCollectionSerializer(type, config, beanDesc);
        }
        // [JACKSON-193]: consider @JsonValue for enum types (and basically any type), so:
        AnnotatedMethod valueMethod = beanDesc.findJsonValueMethod();
        if (valueMethod != null) {
            JsonSerializer<Object> ser = findSerializerFromAnnotation(config, valueMethod);
            return new JsonValueSerializer(valueMethod.getAnnotated(), ser);
           
        }
       
        if (Number.class.isAssignableFrom(cls)) {
            return StdSerializers.NumberSerializer.instance;
View Full Code Here

        }

        /* [JACKSON-80]: Should support @JsonValue, which is alternative to
         *   actual bean method introspection.
         */
        AnnotatedMethod valueMethod = beanDesc.findJsonValueMethod();
        if (valueMethod != null) {
            /* Further, method itself may also be annotated to indicate
             * exact JsonSerializer to use for whatever value is returned...
             */
            ser = findSerializerFromAnnotation(config, valueMethod);
            return new JsonValueSerializer(valueMethod.getAnnotated(), ser);
        }
        return constructBeanSerializer(type, config, beanDesc);
    }
View Full Code Here

            JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, af);
            props.add(pb.buildProperty(en.getKey(), annotatedSerializer, af, staticTyping));
        }

        for (Map.Entry<String,AnnotatedMethod> en : methodsByProp.entrySet()) {
            AnnotatedMethod am = en.getValue();
            if (fixAccess) {
                am.fixAccess();
            }
            // Does Method specify a serializer? If so, let's use it.
            JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, am);
            props.add(pb.buildProperty(en.getKey(), annotatedSerializer, am, staticTyping));
        }
View Full Code Here

TOP

Related Classes of org.codehaus.jackson.map.introspect.AnnotatedMethod

Copyright © 2018 www.massapicom. 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.