public class SpringWebConstraintValidatorFactory
extends java.lang.Object
ConstraintValidatorFactory
implementation that delegates to
the current Spring WebApplicationContext
for creating autowired
ConstraintValidator
instances.
In contrast to
SpringConstraintValidatorFactory
,
this variant is meant for declarative use in a standard validation.xml
file,
e.g. in combination with JAX-RS or JAX-WS.
ContextLoader.getCurrentWebApplicationContext()
,
SpringConstraintValidatorFactory
Constructor and Description |
---|
SpringWebConstraintValidatorFactory() |
Modifier and Type | Method and Description |
---|---|
<T extends <any>> |
getInstance(java.lang.Class<T> key) |
protected WebApplicationContext |
getWebApplicationContext()
Retrieve the Spring
WebApplicationContext to use. |
void |
releaseInstance(<any> instance) |
public <T extends <any>> T getInstance(java.lang.Class<T> key)
public void releaseInstance(<any> instance)
protected WebApplicationContext getWebApplicationContext()
WebApplicationContext
to use.
The default implementation returns the current WebApplicationContext
as registered for the thread context class loader.null
)ContextLoader.getCurrentWebApplicationContext()