Class ValidatorBean
java.lang.Object
org.hibernate.validator.cdi.internal.ValidatorBean
- All Implemented Interfaces:
Contextual<Validator>,Bean<Validator>,BeanAttributes<Validator>,PassivationCapable
A
Bean representing a Validator. There is one instance of this type representing the default
validator and optionally another instance representing the HV validator in case the default provider is not HV.- Author:
- Hardy Ferentschik, Gunnar Morling
-
Constructor Summary
ConstructorsConstructorDescriptionValidatorBean(BeanManager beanManager, Bean<?> validatorFactoryBean, ValidationProviderHelper validationProviderHelper) -
Method Summary
Modifier and TypeMethodDescriptioncreate(CreationalContext<Validator> ctx) Create a new instance of the contextual type.voiddestroy(Validator instance, CreationalContext<Validator> ctx) Destroy an instance of the contextual type.Class<?>The bean class of the managed bean or session bean or of the bean that declares the producer method or field.getId()A string that uniquely identifies the instance ofBeanorContextual.Obtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.getName()Obtains the EL name of a bean, if it has one.Obtains the qualifiers of the bean.Class<? extends Annotation>getScope()Obtains the scope of the bean.Set<Class<? extends Annotation>>Obtains the stereotypes of the bean.getTypes()Obtains the bean types of the bean.booleanDetermines if the bean is an alternative.booleantoString()
-
Constructor Details
-
ValidatorBean
public ValidatorBean(BeanManager beanManager, Bean<?> validatorFactoryBean, ValidationProviderHelper validationProviderHelper)
-
-
Method Details
-
getBeanClass
Description copied from interface:BeanThe bean class of the managed bean or session bean or of the bean that declares the producer method or field.- Specified by:
getBeanClassin interfaceBean<Validator>- Returns:
- the bean class
-
getInjectionPoints
Description copied from interface:BeanObtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.- Specified by:
getInjectionPointsin interfaceBean<Validator>- Returns:
- the set of injection points of the bean
-
getName
Description copied from interface:BeanAttributesObtains the EL name of a bean, if it has one.- Specified by:
getNamein interfaceBeanAttributes<Validator>- Returns:
- the EL name
-
getQualifiers
Description copied from interface:BeanAttributesObtains the qualifiers of the bean.- Specified by:
getQualifiersin interfaceBeanAttributes<Validator>- Returns:
- the qualifiers
-
getScope
Description copied from interface:BeanAttributesObtains the scope of the bean.- Specified by:
getScopein interfaceBeanAttributes<Validator>- Returns:
- the scope
-
getStereotypes
Description copied from interface:BeanAttributesObtains the stereotypes of the bean.- Specified by:
getStereotypesin interfaceBeanAttributes<Validator>- Returns:
- the set of stereotypes
-
getTypes
Description copied from interface:BeanAttributesObtains the bean types of the bean.- Specified by:
getTypesin interfaceBeanAttributes<Validator>- Returns:
- the bean types
-
isAlternative
public boolean isAlternative()Description copied from interface:BeanAttributesDetermines if the bean is an alternative. A custom implementation ofBeanmay implementPrioritizedin order to be selected for the application.Prioritized.getPriority()determines the priority used to resolve ambiguities.- Specified by:
isAlternativein interfaceBeanAttributes<Validator>- Returns:
trueif the bean is an alternative, andfalseotherwise.
-
isNullable
public boolean isNullable() -
create
Description copied from interface:ContextualCreate a new instance of the contextual type. Instances should use the givenCreationalContextwhen obtaining contextual references to inject, in order to ensure that any dependent objects are associated with the contextual instance that is being created. An implementation may callCreationalContext.push(Object)between instantiation and injection to help the container minimize the use of client proxy objects.- Specified by:
createin interfaceContextual<Validator>- Parameters:
ctx- the context in which this instance is being created- Returns:
- the contextual instance
-
destroy
Description copied from interface:ContextualDestroy an instance of the contextual type. Implementations should callCreationalContext.release()to allow the container to destroy dependent objects of the contextual instance.- Specified by:
destroyin interfaceContextual<Validator>- Parameters:
instance- the contextual instance to destroyctx- the context in which this instance was created
-
getId
Description copied from interface:PassivationCapableA string that uniquely identifies the instance ofBeanorContextual. It is recommended that the string contain the package name of the class that implementsBeanorContextual.- Specified by:
getIdin interfacePassivationCapable- Returns:
- a unique identifier for the
BeanorContextual
-
toString
-