Skip to content

Commit

Permalink
chore: fix HasValidator javadoc (#14113) (#14115)
Browse files Browse the repository at this point in the history
The error in javadoc example is fixed
so the getDefaultValidator represent
the correct implementation.

Co-authored-by: Soroosh Taefi <[email protected]>
  • Loading branch information
vaadin-bot and taefi authored Jun 30, 2022
1 parent 1dbd743 commit e2f5d2f
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ default Validator<V> getDefaultValidator() {
* &#64;Tag("date-picker-demo")
* public class DatePickerDemo implements HasValidator&lt;LocalDate&gt; {
*
* // Each web component has a way to communicate its validation status
* // to its server-side component instance. The following clientSideValid
* // state is introduced here just for the sake of simplicity of this code
* // snippet:
* boolean clientSideValid = true;
*
* /**
Expand All @@ -83,8 +87,8 @@ default Validator<V> getDefaultValidator() {
* *&#47;
* &#64;Override
* public Validator getDefaultValidator() {
* return clientSideValid ? ValidationResult.ok()
* : ValidationResult.error("Invalid date format");
* return (value, valueContext) -> clientSideValid ? ValidationResult.ok()
* : ValidationResult.error("Invalid date format");
* }
*
* private final Collection&lt;ValidationStatusChangeListener&lt;LocalDate&gt;&gt;
Expand All @@ -102,10 +106,6 @@ default Validator<V> getDefaultValidator() {
* return () -&gt; validationStatusListeners.remove(listener);
* }
*
* // Each web-component has a way to communicate its validation status
* // to its server-side component instance which can update
* // <code>this.clientSideValid</code> state.
*
* private void fireValidationStatusChangeEvent(
* boolean newValidationStatus) {
* if (this.clientSideValid != newValidationStatus) {
Expand Down

0 comments on commit e2f5d2f

Please sign in to comment.