-
public interface ValidatorFactory
Factory returning initializedValidator
instances. Implementations are thread-safe and instances are typically cached and reused.- Author:
- Emmanuel Bernard, Gunnar Morling, Hardy Ferentschik
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
close()
Closes theValidatorFactory
instance.ConstraintValidatorFactory
getConstraintValidatorFactory()
Returns theConstraintValidatorFactory
instance configured at initialization time for theValidatorFactory
.MessageInterpolator
getMessageInterpolator()
Returns theMessageInterpolator
instance configured at initialization time for theValidatorFactory
.ParameterNameProvider
getParameterNameProvider()
Returns theParameterNameProvider
instance configured at initialization time for theValidatorFactory
.TraversableResolver
getTraversableResolver()
Returns theTraversableResolver
instance configured at initialization time for theValidatorFactory
.Validator
getValidator()
Returns an initializedValidator
instance using the factory defaults for message interpolator, traversable resolver and constraint validator factory.<T> T
unwrap(Class<T> type)
Returns an instance of the specified type allowing access to provider-specific APIs.ValidatorContext
usingContext()
Defines a new validator context and returns aValidator
compliant this new context.
-
-
-
Method Detail
-
getValidator
Validator getValidator()
Returns an initializedValidator
instance using the factory defaults for message interpolator, traversable resolver and constraint validator factory. Validator instances can be pooled and shared by the implementation.- Returns:
- an initialized
Validator
instance
-
usingContext
ValidatorContext usingContext()
Defines a new validator context and returns aValidator
compliant this new context.- Returns:
- a
ValidatorContext
instance
-
getMessageInterpolator
MessageInterpolator getMessageInterpolator()
Returns theMessageInterpolator
instance configured at initialization time for theValidatorFactory
. This is the instance used bygetValidator()
.- Returns:
MessageInterpolator
instance
-
getTraversableResolver
TraversableResolver getTraversableResolver()
Returns theTraversableResolver
instance configured at initialization time for theValidatorFactory
. This is the instance used bygetValidator()
.- Returns:
TraversableResolver
instance
-
getConstraintValidatorFactory
ConstraintValidatorFactory getConstraintValidatorFactory()
Returns theConstraintValidatorFactory
instance configured at initialization time for theValidatorFactory
. This is the instance used bygetValidator()
.- Returns:
ConstraintValidatorFactory
instance
-
getParameterNameProvider
ParameterNameProvider getParameterNameProvider()
Returns theParameterNameProvider
instance configured at initialization time for theValidatorFactory
. This is the instance used by #getValidator().- Returns:
ParameterNameProvider
instance- Since:
- 1.1
-
unwrap
<T> T unwrap(Class<T> type)
Returns an instance of the specified type allowing access to provider-specific APIs. If the Bean Validation provider implementation does not support the specified class, aValidationException
is thrown.- Parameters:
type
- the class of the object to be returned- Returns:
- an instance of the specified class
- Throws:
ValidationException
- if the provider does not support the call.
-
close
void close()
Closes theValidatorFactory
instance. After theValidatorFactory
instance is closed, calling the following methods is not allowed:- methods of this
ValidatorFactory
instance - methods of
Validator
instances created by thisValidatorFactory
- Since:
- 1.1
- methods of this
-
-
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/validatorfactory.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.