Skip to content

Commit 34798a4

Browse files
committed
Fix warnings, polish Javadoc for @validated et al.
1 parent e648245 commit 34798a4

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

org.springframework.context/src/main/java/org/springframework/validation/SmartValidator.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@
2626
public interface SmartValidator extends Validator {
2727

2828
/**
29-
* Validate the supplied <code>target</code> object, which must be
30-
* of a {@link Class} for which the {@link #supports(Class)} method
31-
* typically has (or would) return <code>true</code>.
32-
* <p>The supplied {@link Errors errors} instance can be used to report
33-
* any resulting validation errors.
34-
* <p><b>This variant of <code>validate</code> supports validation hints,
35-
* such as validation groups against a JSR-303 provider</b> (in this case,
36-
* the provided hint objects need to be annotation arguments of type Class).
37-
* <p>Note: Validation hints may get ignored by the actual target Validator,
29+
* Validate the supplied {@code target} object, which must be of a {@link Class} for
30+
* which the {@link #supports(Class)} method typically has (or would) return {@code true}.
31+
* <p>The supplied {@link Errors errors} instance can be used to report any
32+
* resulting validation errors.
33+
* <p><b>This variant of {@code validate} supports validation hints, such as
34+
* validation groups against a JSR-303 provider</b> (in this case, the provided hint
35+
* objects need to be annotation arguments of type {@code Class}).
36+
* <p>Note: Validation hints may get ignored by the actual target {@code Validator},
3837
* in which case this method is supposed to be behave just like its regular
3938
* {@link #validate(Object, Errors)} sibling.
40-
* @param target the object that is to be validated (can be <code>null</code>)
41-
* @param errors contextual state about the validation process (never <code>null</code>)
39+
* @param target the object that is to be validated (can be {@code null})
40+
* @param errors contextual state about the validation process (never {@code null})
4241
* @param validationHints one or more hint objects to be passed to the validation engine
4342
* @see ValidationUtils
4443
*/

org.springframework.context/src/main/java/org/springframework/validation/annotation/Validated.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@
5858
* <p>Other {@link org.springframework.validation.SmartValidator} implementations may
5959
* support class arguments in other ways as well.
6060
*/
61-
Class[] value() default {};
61+
Class<?>[] value() default {};
6262

6363
}

org.springframework.context/src/main/java/org/springframework/validation/beanvalidation/MethodValidationPostProcessor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@
4646
*
4747
* <p>Applicable methods have JSR-303 constraint annotations on their parameters
4848
* and/or on their return value (in the latter case specified at the method level,
49-
* typically as inline annotation).
49+
* typically as inline annotation), e.g.:
5050
*
51-
* <p>E.g.: <code>public @NotNull Object myValidMethod(@NotNull String arg1, @Max(10) int arg2)</code>
51+
* <pre class="code">
52+
* public @NotNull Object myValidMethod(@NotNull String arg1, @Max(10) int arg2)
53+
* </pre>
5254
*
5355
* <p>Target classes with such annotated methods need to be annotated with Spring's
5456
* {@link Validated} annotation at the type level, for their methods to be searched for
55-
* inline constraint annotations. Validation groups can be specified through {@link Validated}
57+
* inline constraint annotations. Validation groups can be specified through {@code @Validated}
5658
* as well. By default, JSR-303 will validate against its default group only.
5759
*
5860
* <p>As of Spring 3.1, this functionality requires Hibernate Validator 4.2 or higher.
@@ -64,6 +66,7 @@
6466
* @see MethodValidationInterceptor
6567
* @see org.hibernate.validator.method.MethodValidator
6668
*/
69+
@SuppressWarnings("serial")
6770
public class MethodValidationPostProcessor extends ProxyConfig
6871
implements BeanPostProcessor, BeanClassLoaderAware, Ordered, InitializingBean {
6972

0 commit comments

Comments
 (0)