Skip to content

Adding hyperlinks in @Constraint javadoc to aid users in navigating#307

Merged
marko-bekhta merged 2 commits intojakartaee:mainfrom
PrittSpadeLord:main
Oct 13, 2025
Merged

Adding hyperlinks in @Constraint javadoc to aid users in navigating#307
marko-bekhta merged 2 commits intojakartaee:mainfrom
PrittSpadeLord:main

Conversation

@PrittSpadeLord
Copy link
Contributor

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

Copy link
Member

@marko-bekhta marko-bekhta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>&lt;? extends </code>{@link Payload}<code>&gt;[] 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 👍🏻

@PrittSpadeLord
Copy link
Contributor Author

Hello @marko-bekhta! I've applied the changes you have requested. Is this what you were looking for?

Copy link
Member

@marko-bekhta marko-bekhta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 👍🏻 🙂

@marko-bekhta marko-bekhta merged commit 75a5452 into jakartaee:main Oct 13, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants