Code example for FormHttpMessageConverter

0
 */ 
public final class FormOAuth2ExceptionHttpMessageConverter implements HttpMessageConverter<OAuth2Exception> {
 
	private static final List<MediaType> SUPPORTED_MEDIA = Collections.singletonList(MediaType.APPLICATION_FORM_URLENCODED);
 
	private final FormHttpMessageConverter delegateMessageConverter = new FormHttpMessageConverter();
 
	public boolean canRead(Class<?> clazz, MediaType mediaType) {
		return OAuth2Exception.class.equals(clazz) && MediaType.APPLICATION_FORM_URLENCODED.equals(mediaType);
	} 
 
	public boolean canWrite(Class<?> clazz, MediaType mediaType) {
		return OAuth2Exception.class.equals(clazz) && MediaType.APPLICATION_FORM_URLENCODED.equals(mediaType);
	} 
 
	public List<MediaType> getSupportedMediaTypes() {
		return SUPPORTED_MEDIA;
	} 
 
	public OAuth2Exception read(Class<? extends OAuth2Exception> clazz, HttpInputMessage inputMessage)
Experience pair programming with AI  Get Codota for Java