JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, accessor, property);
JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (ser != null) { return (JsonSerializer<Object>) ser;
JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, accessor, property);
JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (ser != null) { return (JsonSerializer<Object>) ser;
JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, af); BeanPropertyWriter pbw = pb.buildProperty(en.getKey(), annotatedSerializer, af, staticTyping); JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, am); BeanPropertyWriter pbw = pb.buildProperty(en.getKey(), annotatedSerializer, am, staticTyping); pbw.setViews(intr.findSerializationViews(am));
/** * Method that will try to construct a {@link BeanSerializer} for * given class. Returns null if no properties are found. */ public JsonSerializer<Object> findBeanSerializer(Class<?> type, SerializationConfig config, BasicBeanDescription beanDesc) { // First things first: we know some types are not beans... if (!isPotentialBeanType(type)) { return null; } /* [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... */ JsonSerializer<Object> ser = findSerializerFromAnnotation(config, valueMethod); return new JsonValueSerializer(valueMethod.getAnnotated(), ser); } return constructBeanSerializer(config, beanDesc); }
JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo()); if (ser == null) {
JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, accessor, property);
/** * Secondary helper method for constructing {@link BeanPropertyWriter} for * given member (field or method). */ protected BeanPropertyWriter _constructWriter(SerializationConfig config, TypeBindings typeContext, PropertyBuilder pb, boolean staticTyping, String name, AnnotatedMember accessor) throws JsonMappingException { if (config.isEnabled(SerializationConfig.Feature.CAN_OVERRIDE_ACCESS_MODIFIERS)) { accessor.fixAccess(); } JavaType type = accessor.getType(typeContext); BeanProperty.Std property = new BeanProperty.Std(name, type, pb.getClassAnnotations(), accessor); // Does member specify a serializer? If so, let's use it. JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, accessor, property); // And how about polymorphic typing? First special to cover JAXB per-field settings: TypeSerializer contentTypeSer = null; if (ClassUtil.isCollectionMapOrArray(type.getRawClass())) { contentTypeSer = findPropertyContentTypeSerializer(type, config, accessor, property); } // and if not JAXB collection/array with annotations, maybe regular type info? TypeSerializer typeSer = findPropertyTypeSerializer(type, config, accessor, property); BeanPropertyWriter pbw = pb.buildWriter(name, type, annotatedSerializer, typeSer, contentTypeSer, accessor, staticTyping); // how about views? (1.4+) AnnotationIntrospector intr = config.getAnnotationIntrospector(); pbw.setViews(intr.findSerializationViews(accessor)); return pbw; }
JsonSerializer<Object> annotatedSerializer = findSerializerFromAnnotation(config, accessor, property);
JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (ser != null) { return (JsonSerializer<Object>) ser;
JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (ser != null) { return (JsonSerializer<Object>) ser;
JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo(), property); if (ser != null) { return (JsonSerializer<Object>) ser;