javax.validation.executable

Annotation Type ValidateOnExecution


  • @Target(value={CONSTRUCTOR,METHOD,TYPE,PACKAGE})
     @Retention(value=RUNTIME)
    public @interface ValidateOnExecution
    Expresses which executables (methods or constructors) should have their parameters and return value validated upon execution. Can be on executable (method, constructor) or type level (with the former taking precedence).

    If not present for a given executable, the default configuration from META-INF/validation.xml and finally the implicit default validated executable types (constructors and non-getters) are taken into account to determine whether a given executable is validated upon execution or not.

    The following describes the formal rules for deciding whether an executable is validated. They are applied in decreasing order:

    • the executable is validated if it is annotated with @ValidateOnExecution and the type attribute contains the executable type or ExecutableType.IMPLICIT. If the type attribute does neither contain the executable type nor IMPLICIT, the executable is not validated.
    • otherwise the executable is validated if the type (class, interface) on which it is declared is annotated with @ValidateOnExecution and the type attribute contains the executable type. If the type attribute contains IMPLICIT, then this rule is ignored and the behavior is equivalent to ValidateOnExecution not being present. If the type attribute does not contain the executable type, the executable is not validated.
    • otherwise the executable is validated if the global executable validation setting contains the executable type. If the global setting does not contain the executable type, the executable is not validated.
    • The rules above do not apply to methods overriding a superclass method or implementing an interface method. In this case, the method inherits the behavior of the method it overrides or implements. Out of the box, a conforming implementation raises a ValidationException if the overriding / implementing method hosts the ValidateOnExecution annotation.

    Note that you can exclude an executable from validation by making sure the rules above do not match or by annotating the executable with @ValidateOnExecution(NONE).

    Since:
    1.1
    Author:
    Emmanuel Bernard
    • Element Detail

      • type

        public abstract ExecutableType[] type
        List of executable types to be validated when called. Defaults to the types discovered implicitly (see ExecutableType.IMPLICIT).
        Default:
        javax.validation.executable.ExecutableType.IMPLICIT

Nederlandse vertaling

U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.

Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.

Bij voorbaat dank.

Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/validation/executable/validateonexecution.html

De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.

Referenties

  1. Bekijk - html-document Taal van het document:fr Manuel PHP : https://docs.oracle.com

Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.