Adding hyperlinks in @Constraint javadoc to aid users in navigating#307
Merged
marko-bekhta merged 2 commits intojakartaee:mainfrom Oct 13, 2025
Merged
Adding hyperlinks in @Constraint javadoc to aid users in navigating#307marko-bekhta merged 2 commits intojakartaee:mainfrom
marko-bekhta merged 2 commits intojakartaee:mainfrom
Conversation
marko-bekhta
requested changes
Oct 13, 2025
Member
marko-bekhta
left a comment
There was a problem hiding this comment.
Hey @PrittSpadeLord
thanks for the PR!
I've added some comments inline.
Comment on lines
-27
to
38
| * <li>{@code String message() default [...];} which should default to an error | ||
| * message key made of the fully-qualified class name of the constraint followed by | ||
| * {@code .message}. For example {@code "{com.acme.constraints.NotSafe.message}"}</li> | ||
| * <li>{@code Class<?>[] groups() default {};} for user to customize the targeted | ||
| * groups</li> | ||
| * <li>{@code Class<? extends Payload>[] payload() default {};} for | ||
| * extensibility purposes</li> | ||
| * <li>{@link String}<code> message() default [...];</code> which should default to an error message key made of the fully-qualified class name of the constraint followed by <code>.message</code>. For example <code>"{com.acme.constraints.NotSafe.message}"</code></li> | ||
| * <li>{@link Class}<code><?>[] groups() default {};</code> for user to customize the targeted groups</li> | ||
| * <li>{@link Class}<code><? extends </code>{@link Payload}<code>>[] payload() default {};</code> for extensibility purposes</li> | ||
| * </ul> | ||
| * <p> | ||
| * When building a constraint that is both generic and cross-parameter, the constraint | ||
| * annotation must host the {@code validationAppliesTo()} property. | ||
| * A constraint is generic if it targets the annotated element and is cross-parameter if | ||
| * it targets the array of parameters of a method or constructor. | ||
| * <pre> | ||
| * ConstraintTarget validationAppliesTo() default ConstraintTarget.IMPLICIT; | ||
| * {@link ConstraintTarget} validationAppliesTo() default {@link ConstraintTarget#IMPLICIT}; | ||
| * </pre> |
Member
There was a problem hiding this comment.
Let's leave these code fragments as they were. This makes the docs inconsistent and it would be harder to apply the styles, if one day we decide to apply a custom theme to the javadocs.
Instead we can add:
* @see Payload
* @see ConstraintTarget
at the bottom of this comment.
other code -> link updates in this PR look good 👍🏻
Contributor
Author
|
Hello @marko-bekhta! I've applied the changes you have requested. Is this what you were looking for? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've replaced some of the generic code-format names of classes to a clickable hyperlink. I believe this should make things easier for users visiting this page on the Javadoc to navigate