Package play.data.validation
Class MappedConstraintValidatorFactory
- Object
-
- play.data.validation.MappedConstraintValidatorFactory
-
- All Implemented Interfaces:
javax.validation.ConstraintValidatorFactory
public class MappedConstraintValidatorFactory extends Object implements javax.validation.ConstraintValidatorFactory
ConstraintValidatorFactory to be used with compile-time Dependency Injection.
-
-
Constructor Summary
Constructors Constructor Description MappedConstraintValidatorFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends javax.validation.ConstraintValidator<?,?>>
MappedConstraintValidatorFactoryaddConstraintValidator(Class<T> key, Supplier<T> constraintValidator)
Adds validator as a non-singleton.<T extends javax.validation.ConstraintValidator<?,?>>
MappedConstraintValidatorFactoryaddConstraintValidator(Class<T> key, T constraintValidator)
Adds validator as a singleton.<T extends javax.validation.ConstraintValidator<?,?>>
TgetInstance(Class<T> key)
void
releaseInstance(javax.validation.ConstraintValidator<?,?> instance)
-
-
-
Method Detail
-
addConstraintValidator
public <T extends javax.validation.ConstraintValidator<?,?>> MappedConstraintValidatorFactory addConstraintValidator(Class<T> key, T constraintValidator)
Adds validator as a singleton.- Type Parameters:
T
- the type of constraint validator implementation- Parameters:
key
- the constraint validator typeconstraintValidator
- the constraint validator instance- Returns:
MappedConstraintValidatorFactory
with the given constraint validator added.
-
addConstraintValidator
public <T extends javax.validation.ConstraintValidator<?,?>> MappedConstraintValidatorFactory addConstraintValidator(Class<T> key, Supplier<T> constraintValidator)
Adds validator as a non-singleton.- Type Parameters:
T
- the type of constraint validator implementation- Parameters:
key
- the constraint validator typeconstraintValidator
- the constraint validator instance- Returns:
MappedConstraintValidatorFactory
with the given constraint validator added.
-
getInstance
public <T extends javax.validation.ConstraintValidator<?,?>> T getInstance(Class<T> key)
- Specified by:
getInstance
in interfacejavax.validation.ConstraintValidatorFactory
-
releaseInstance
public void releaseInstance(javax.validation.ConstraintValidator<?,?> instance)
- Specified by:
releaseInstance
in interfacejavax.validation.ConstraintValidatorFactory
-
-