sling-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Lietz (JIRA)" <>
Subject [jira] [Commented] (SLING-6660) Validators should expose their id and severity
Date Sun, 19 Mar 2017 19:25:41 GMT


Oliver Lietz commented on SLING-6660:

[~kwin], [~cziegeler]: {{severity}} is part of the Java API/SPI anyway, so why not enforce
and expose it in {{Validator}} also? And why not enforce {{id}} also instead of throwing an
exception at runtime? We can provide a base validator which returns {{0}} for {{severity}}
and class name for {{id}}. I really prefer having both in {{Validator}} instead of having
{{ValidatorAndSeverity}} in API.

bq. Not too sure what is the better solution, though. At least for
it is also required to set some service properties (without exposing those values through
dedicated methods).

Requiring service properties is not my point (that's fine for some cases), but less code in
and making [{{ValidatorAndSeverity}}|]

> Validators should expose their id and severity
> ----------------------------------------------
>                 Key: SLING-6660
>                 URL:
>             Project: Sling
>          Issue Type: Improvement
>          Components: Extensions, Validation
>            Reporter: Oliver Lietz
> {{Validator}}s should expose their {{id}} and {{severity}} (maybe from service properties,
but haven't to be service properties at all) by their own:
> {noformat}
> [...]
> public interface Validator <T> {
> [...]
>     String getId(); //
>     int getSeverity(); // validator.severity
> [...]
> }
> {noformat}
> This addition allows less code in {{ValidationModelRetrieverImpl}} and makes {{ValidatorAndSeverity}}

This message was sent by Atlassian JIRA

View raw message