Boolean result = ignores.get(type); if (result == null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); AnnotatedClass ac = desc.getClassInfo(); result = intr.isIgnorableType(ac);
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType type, BeanProperty property) { // Minor optimization: to avoid constructing beanDesc, bail out if none registered if (!_factoryConfig.hasKeySerializers()) { return null; } // We should not need any member method info; at most class annotations for Map type BasicBeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass()); JsonSerializer<?> ser = null; // Only thing we have here are module-provided key serializers: for (Serializers serializers : _factoryConfig.keySerializers()) { ser = serializers.findSerializer(config, type, beanDesc, property); if (ser != null) { break; } } return (JsonSerializer<Object>) ser; }
/** * Method called to construct a type serializer for values with given declared * base type. This is called for values other than those of bean property * types. */ @Override public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) { BasicBeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); AnnotationIntrospector ai = config.getAnnotationIntrospector(); TypeResolverBuilder<?> b = ai.findTypeResolver(config, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = config.getDefaultTyper(baseType); } else { subtypes = config.getSubtypeResolver().collectAndResolveSubtypes(ac, config, ai); } return (b == null) ? null : b.buildTypeSerializer(config, baseType, subtypes, property); }
Boolean result = ignores.get(type); if (result == null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); AnnotatedClass ac = desc.getClassInfo(); result = intr.isIgnorableType(ac);
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType type, BeanProperty property) { // Minor optimization: to avoid constructing beanDesc, bail out if none registered if (!_factoryConfig.hasKeySerializers()) { return null; } // We should not need any member method info; at most class annotations for Map type BasicBeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass()); JsonSerializer<?> ser = null; // Only thing we have here are module-provided key serializers: for (Serializers serializers : _factoryConfig.keySerializers()) { ser = serializers.findSerializer(config, type, beanDesc, property); if (ser != null) { break; } } return (JsonSerializer<Object>) ser; }
/** * Method called to construct a type serializer for values with given declared * base type. This is called for values other than those of bean property * types. */ @Override public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) { BasicBeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); AnnotationIntrospector ai = config.getAnnotationIntrospector(); TypeResolverBuilder<?> b = ai.findTypeResolver(config, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = config.getDefaultTyper(baseType); } else { subtypes = config.getSubtypeResolver().collectAndResolveSubtypes(ac, config, ai); } return (b == null) ? null : b.buildTypeSerializer(config, baseType, subtypes, property); }
Boolean result = ignores.get(type); if (result == null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); AnnotatedClass ac = desc.getClassInfo(); result = intr.isIgnorableType(ac);
Boolean result = ignores.get(type); if (result == null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); AnnotatedClass ac = desc.getClassInfo(); result = intr.isIgnorableType(ac);
Boolean result = ignores.get(type); if (result == null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); AnnotatedClass ac = desc.getClassInfo(); result = intr.isIgnorableType(ac);
BasicBeanDescription desc = config.introspectClassAnnotations(type); JsonSerializer<?> ser = findSerializerFromAnnotation(config, desc.getClassInfo()); if (ser == null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); JsonSerializer<Object> ser = findSerializerFromAnnotation(config, desc.getClassInfo()); if (ser != null) { BasicBeanDescription desc = config.introspectClassAnnotations(type); JsonSerializer<?> ser = findSerializerFromAnnotation(config, desc.getClassInfo()); if (ser == null) {
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType type, BeanProperty property) { // Minor optimization: to avoid constructing beanDesc, bail out if none registered if (!_factoryConfig.hasKeySerializers()) { return null; } // We should not need any member method info; at most class annotations for Map type BasicBeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass()); JsonSerializer<?> ser = null; // Only thing we have here are module-provided key serializers: for (Serializers serializers : _factoryConfig.keySerializers()) { ser = serializers.findSerializer(config, type, beanDesc, property); if (ser != null) { break; } } return (JsonSerializer<Object>) ser; }
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType type, BeanProperty property) { // Minor optimization: to avoid constructing beanDesc, bail out if none registered if (!_factoryConfig.hasKeySerializers()) { return null; } // We should not need any member method info; at most class annotations for Map type BasicBeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass()); JsonSerializer<?> ser = null; // Only thing we have here are module-provided key serializers: for (Serializers serializers : _factoryConfig.keySerializers()) { ser = serializers.findSerializer(config, type, beanDesc, property); if (ser != null) { break; } } return (JsonSerializer<Object>) ser; }
@Override @SuppressWarnings("unchecked") public JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType type, BeanProperty property) { // Minor optimization: to avoid constructing beanDesc, bail out if none registered if (!_factoryConfig.hasKeySerializers()) { return null; } // We should not need any member method info; at most class annotations for Map type BasicBeanDescription beanDesc = config.introspectClassAnnotations(type.getRawClass()); JsonSerializer<?> ser = null; // Only thing we have here are module-provided key serializers: for (Serializers serializers : _factoryConfig.keySerializers()) { ser = serializers.findSerializer(config, type, beanDesc, property); if (ser != null) { break; } } return (JsonSerializer<Object>) ser; }
/** * Helper method that handles configuration details when constructing serializers for * {@link java.util.Map} types. */ protected JsonSerializer<?> buildMapSerializer(Class<?> type, SerializationConfig config) { AnnotationIntrospector intr = config.getAnnotationIntrospector(); BasicBeanDescription beanDesc = config.introspectClassAnnotations(type); // [JACKSON-220]: JsonSerializer<?> ser = findSerializerFromAnnotation(config, beanDesc.getClassInfo()); if (ser == null) { if (EnumMap.class.isAssignableFrom(type)) { ser = new ContainerSerializers.EnumMapSerializer(); } else { ser = MapSerializer.construct(intr.findPropertiesToIgnore(beanDesc.getClassInfo())); } } return ser; }
/** * Method called to construct a type serializer for values with given declared * base type. This is called for values other than those of bean property * types. */ @Override public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) { BasicBeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); AnnotationIntrospector ai = config.getAnnotationIntrospector(); TypeResolverBuilder<?> b = ai.findTypeResolver(config, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = config.getDefaultTyper(baseType); } else { subtypes = config.getSubtypeResolver().collectAndResolveSubtypes(ac, config, ai); } return (b == null) ? null : b.buildTypeSerializer(config, baseType, subtypes, property); }
/** * Method called to construct a type serializer for values with given declared * base type. This is called for values other than those of bean property * types. */ @Override public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) { BasicBeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); AnnotationIntrospector ai = config.getAnnotationIntrospector(); TypeResolverBuilder<?> b = ai.findTypeResolver(config, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = config.getDefaultTyper(baseType); } else { subtypes = config.getSubtypeResolver().collectAndResolveSubtypes(ac, config, ai); } return (b == null) ? null : b.buildTypeSerializer(config, baseType, subtypes, property); }
/** * Method called to construct a type serializer for values with given declared * base type. This is called for values other than those of bean property * types. */ @Override public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) { BasicBeanDescription bean = config.introspectClassAnnotations(baseType.getRawClass()); AnnotatedClass ac = bean.getClassInfo(); AnnotationIntrospector ai = config.getAnnotationIntrospector(); TypeResolverBuilder<?> b = ai.findTypeResolver(config, ac, baseType); /* Ok: if there is no explicit type info handler, we may want to * use a default. If so, config object knows what to use. */ Collection<NamedType> subtypes = null; if (b == null) { b = config.getDefaultTyper(baseType); } else { subtypes = config.getSubtypeResolver().collectAndResolveSubtypes(ac, config, ai); } return (b == null) ? null : b.buildTypeSerializer(config, baseType, subtypes, property); }