/** * Whether this converter should convert messages for which no content type * could be resolved through the configured * {@link org.springframework.messaging.converter.ContentTypeResolver}. * <p>A converter can configured to be strict only when a * {@link #setContentTypeResolver contentTypeResolver} is configured and the * list of {@link #getSupportedMimeTypes() supportedMimeTypes} is not be empty. * <p>When this flag is set to {@code true}, {@link #supportsMimeType(MessageHeaders)} * will return {@code false} if the {@link #setContentTypeResolver contentTypeResolver} * is not defined or if no content-type header is present. */ public void setStrictContentTypeMatch(boolean strictContentTypeMatch) { if (strictContentTypeMatch) { Assert.notEmpty(getSupportedMimeTypes(), "Strict match requires non-empty list of supported mime types"); Assert.notNull(getContentTypeResolver(), "Strict match requires ContentTypeResolver"); } this.strictContentTypeMatch = strictContentTypeMatch; }
/** * Whether this converter should convert messages for which no content type * could be resolved through the configured * {@link org.springframework.messaging.converter.ContentTypeResolver}. * <p>A converter can configured to be strict only when a * {@link #setContentTypeResolver contentTypeResolver} is configured and the * list of {@link #getSupportedMimeTypes() supportedMimeTypes} is not be empty. * <p>When this flag is set to {@code true}, {@link #supportsMimeType(MessageHeaders)} * will return {@code false} if the {@link #setContentTypeResolver contentTypeResolver} * is not defined or if no content-type header is present. */ public void setStrictContentTypeMatch(boolean strictContentTypeMatch) { if (strictContentTypeMatch) { Assert.notEmpty(getSupportedMimeTypes(), "Strict match requires non-empty list of supported mime types"); Assert.notNull(getContentTypeResolver(), "Strict match requires ContentTypeResolver"); } this.strictContentTypeMatch = strictContentTypeMatch; }
/** * Whether this converter should convert messages for which no content type * could be resolved through the configured * {@link org.springframework.messaging.converter.ContentTypeResolver}. * <p>A converter can configured to be strict only when a * {@link #setContentTypeResolver contentTypeResolver} is configured and the * list of {@link #getSupportedMimeTypes() supportedMimeTypes} is not be empty. * <p>When this flag is set to {@code true}, {@link #supportsMimeType(MessageHeaders)} * will return {@code false} if the {@link #setContentTypeResolver contentTypeResolver} * is not defined or if no content-type header is present. */ public void setStrictContentTypeMatch(boolean strictContentTypeMatch) { if (strictContentTypeMatch) { Assert.notEmpty(getSupportedMimeTypes(), "Strict match requires non-empty list of supported mime types"); Assert.notNull(getContentTypeResolver(), "Strict match requires ContentTypeResolver"); } this.strictContentTypeMatch = strictContentTypeMatch; }
/** * Whether this converter should convert messages for which no content type * could be resolved through the configured * {@link org.springframework.messaging.converter.ContentTypeResolver}. * <p>A converter can configured to be strict only when a * {@link #setContentTypeResolver contentTypeResolver} is configured and the * list of {@link #getSupportedMimeTypes() supportedMimeTypes} is not be empty. * <p>When this flag is set to {@code true}, {@link #supportsMimeType(MessageHeaders)} * will return {@code false} if the {@link #setContentTypeResolver contentTypeResolver} * is not defined or if no content-type header is present. */ public void setStrictContentTypeMatch(boolean strictContentTypeMatch) { if (strictContentTypeMatch) { Assert.notEmpty(getSupportedMimeTypes(), "Strict match requires non-empty list of supported mime types"); Assert.notNull(getContentTypeResolver(), "Strict match requires ContentTypeResolver"); } this.strictContentTypeMatch = strictContentTypeMatch; }