-
@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 fromMETA-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 thetype
attribute contains the executable type orExecutableType.IMPLICIT
. If thetype
attribute does neither contain the executable type norIMPLICIT
, 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 thetype
attribute contains the executable type. If thetype
attribute containsIMPLICIT
, then this rule is ignored and the behavior is equivalent toValidateOnExecution
not being present. If thetype
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 theValidateOnExecution
annotation.
@ValidateOnExecution(NONE)
.- Since:
- 1.1
- Author:
- Emmanuel Bernard
- the executable is validated if it is annotated with
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element and Description ExecutableType[]
type
List of executable types to be validated when called.
-
-
-
Element Detail
-
type
public abstract ExecutableType[] type
List of executable types to be validated when called. Defaults to the types discovered implicitly (seeExecutableType.IMPLICIT
).- Default:
- javax.validation.executable.ExecutableType.IMPLICIT
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/validation/executable/validateonexecution.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.