/** * Reflection-based serialized find method, which checks if * given class implements one of recognized "add-on" interfaces. * Add-on here means a role that is usually or can be a secondary * trait: for example, * bean classes may implement {@link Iterable}, but their main * function is usually something else. The reason for */ public final JsonSerializer<?> findSerializerByAddonType(SerializationConfig config, JavaType javaType, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) throws JsonMappingException { Class<?> type = javaType.getRawClass(); // These need to be in decreasing order of specificity... if (Iterator.class.isAssignableFrom(type)) { return buildIteratorSerializer(config, javaType, beanDesc, property, staticTyping); } if (Iterable.class.isAssignableFrom(type)) { return buildIterableSerializer(config, javaType, beanDesc, property, staticTyping); } if (CharSequence.class.isAssignableFrom(type)) { return ToStringSerializer.instance; } return null; }
/** * Reflection-based serialized find method, which checks if * given class implements one of recognized "add-on" interfaces. * Add-on here means a role that is usually or can be a secondary * trait: for example, * bean classes may implement {@link Iterable}, but their main * function is usually something else. The reason for */ public final JsonSerializer<?> findSerializerByAddonType(SerializationConfig config, JavaType javaType, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) throws JsonMappingException { Class<?> type = javaType.getRawClass(); // These need to be in decreasing order of specificity... if (Iterator.class.isAssignableFrom(type)) { return buildIteratorSerializer(config, javaType, beanDesc, property, staticTyping); } if (Iterable.class.isAssignableFrom(type)) { return buildIterableSerializer(config, javaType, beanDesc, property, staticTyping); } if (CharSequence.class.isAssignableFrom(type)) { return ToStringSerializer.instance; } return null; }
/** * Reflection-based serialized find method, which checks if * given class implements one of recognized "add-on" interfaces. * Add-on here means a role that is usually or can be a secondary * trait: for example, * bean classes may implement {@link Iterable}, but their main * function is usually something else. The reason for */ public final JsonSerializer<?> findSerializerByAddonType(SerializationConfig config, JavaType javaType, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) throws JsonMappingException { Class<?> type = javaType.getRawClass(); // These need to be in decreasing order of specificity... if (Iterator.class.isAssignableFrom(type)) { return buildIteratorSerializer(config, javaType, beanDesc, property, staticTyping); } if (Iterable.class.isAssignableFrom(type)) { return buildIterableSerializer(config, javaType, beanDesc, property, staticTyping); } if (CharSequence.class.isAssignableFrom(type)) { return ToStringSerializer.instance; } return null; }
/** * Reflection-based serialized find method, which checks if * given class implements one of recognized "add-on" interfaces. * Add-on here means a role that is usually or can be a secondary * trait: for example, * bean classes may implement {@link Iterable}, but their main * function is usually something else. The reason for */ public final JsonSerializer<?> findSerializerByAddonType(SerializationConfig config, JavaType javaType, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) throws JsonMappingException { Class<?> type = javaType.getRawClass(); // These need to be in decreasing order of specificity... if (Iterator.class.isAssignableFrom(type)) { return buildIteratorSerializer(config, javaType, beanDesc, property, staticTyping); } if (Iterable.class.isAssignableFrom(type)) { return buildIterableSerializer(config, javaType, beanDesc, property, staticTyping); } if (CharSequence.class.isAssignableFrom(type)) { return ToStringSerializer.instance; } return null; }
/** * Reflection-based serialized find method, which checks if * given class implements one of recognized "add-on" interfaces. * Add-on here means a role that is usually or can be a secondary * trait: for example, * bean classes may implement {@link Iterable}, but their main * function is usually something else. The reason for */ public final JsonSerializer<?> findSerializerByAddonType(SerializationConfig config, JavaType javaType, BasicBeanDescription beanDesc, BeanProperty property, boolean staticTyping) throws JsonMappingException { Class<?> type = javaType.getRawClass(); // These need to be in decreasing order of specificity... if (Iterator.class.isAssignableFrom(type)) { return buildIteratorSerializer(config, javaType, beanDesc, property, staticTyping); } if (Iterable.class.isAssignableFrom(type)) { return buildIterableSerializer(config, javaType, beanDesc, property, staticTyping); } if (CharSequence.class.isAssignableFrom(type)) { return ToStringSerializer.instance; } return null; }