Update javadoc

This commit is contained in:
Rossen Stoyanchev 2014-10-22 22:28:21 -04:00
parent df090235bb
commit 051c5fb66a
2 changed files with 18 additions and 22 deletions

View File

@ -178,20 +178,21 @@ public class ContentNegotiationManagerFactoryBean
} }
/** /**
* Set the default content type. * Set the default content type to use when no content type was requested.
* <p>This content type will be used when neither the request path extension, * <p>Note that internally this method creates and adds a
* nor a request parameter, nor the {@code Accept} header could help * {@link org.springframework.web.accept.FixedContentNegotiationStrategy
* determine the requested content type. * FixedContentNegotiationStrategy}. Alternatively you can also provide a
* custom strategy via {@link #setDefaultContentTypeStrategy}.
*/ */
public void setDefaultContentType(MediaType defaultContentType) { public void setDefaultContentType(MediaType defaultContentType) {
this.defaultNegotiationStrategy = new FixedContentNegotiationStrategy(defaultContentType); this.defaultNegotiationStrategy = new FixedContentNegotiationStrategy(defaultContentType);
} }
/** /**
* Set the {@link ContentNegotiationStrategy} to be used to resolving the default content type. * Configure a custom {@link ContentNegotiationStrategy} to use to determine
* <p>This content type will be used when neither the request path extension, * the default content type to use when no content type was requested.
* nor a request parameter, nor the {@code Accept} header could help determine * <p>However also consider using {@link #setDefaultContentType} which
* the requested content type. * provides a simpler alternative to doing the same.
* @since 4.1.2 * @since 4.1.2
*/ */
public void setDefaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy) { public void setDefaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy) {

View File

@ -158,13 +158,11 @@ public class ContentNegotiationConfigurer {
} }
/** /**
* Set the default content type. * Set the default content type to use when no content type was requested.
* <p>This content type will be used when neither the request path extension, * <p>Note that internally this method creates and adds a
* nor a request parameter, nor the {@code Accept} header could help determine * {@link org.springframework.web.accept.FixedContentNegotiationStrategy
* the requested content type. * FixedContentNegotiationStrategy}. Alternatively you can also provide a
* <p>Note that this method achieves the same goal as {@code defaultContentTypeStrategy}, so both * custom strategy via {@link #defaultContentTypeStrategy}.
* shouldn't be used at the same time.
* @see #defaultContentTypeStrategy(org.springframework.web.accept.ContentNegotiationStrategy)
*/ */
public ContentNegotiationConfigurer defaultContentType(MediaType defaultContentType) { public ContentNegotiationConfigurer defaultContentType(MediaType defaultContentType) {
this.factoryBean.setDefaultContentType(defaultContentType); this.factoryBean.setDefaultContentType(defaultContentType);
@ -172,14 +170,11 @@ public class ContentNegotiationConfigurer {
} }
/** /**
* Set the {@link ContentNegotiationStrategy} to be used to resolving the default content type. * Configure a custom {@link ContentNegotiationStrategy} to use to determine
* <p>This content type will be used when neither the request path extension, * the default content type to use when no content type was requested.
* nor a request parameter, nor the {@code Accept} header could help determine * <p>However also consider using {@link #defaultContentType} which provides
* the requested content type. * a simpler alternative to doing the same.
* <p>Note that this method achieves the same goal as {@code defaultContentType}, so both
* shouldn't be used at the same time.
* @since 4.1.2 * @since 4.1.2
* @see #defaultContentType(org.springframework.http.MediaType)
*/ */
public ContentNegotiationConfigurer defaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy) { public ContentNegotiationConfigurer defaultContentTypeStrategy(ContentNegotiationStrategy defaultStrategy) {
this.factoryBean.setDefaultContentTypeStrategy(defaultStrategy); this.factoryBean.setDefaultContentTypeStrategy(defaultStrategy);