Class ValidatorFactoryBean
- java.lang.Object
-
- org.hibernate.validator.cdi.internal.ValidatorFactoryBean
-
- All Implemented Interfaces:
Contextual<ValidatorFactory>,Bean<ValidatorFactory>,BeanAttributes<ValidatorFactory>,PassivationCapable
public class ValidatorFactoryBean extends Object implements Bean<ValidatorFactory>, PassivationCapable
ABeanrepresenting aValidatorFactory. There is one instance of this type representing the default validator factory and optionally another instance representing the HV validator factory in case the default provider is not HV.- Author:
- Hardy Ferentschik, Gunnar Morling, Guillaume Smet
-
-
Constructor Summary
Constructors Constructor Description ValidatorFactoryBean(BeanManager beanManager, ValidationProviderHelper validationProviderHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ValidatorFactorycreate(CreationalContext<ValidatorFactory> ctx)Create a new instance of the contextual type.voiddestroy(ValidatorFactory instance, CreationalContext<ValidatorFactory> ctx)Destroy an instance of the contextual type.Class<?>getBeanClass()The bean class of the managed bean or session bean or of the bean that declares the producer method or field.StringgetId()A string that uniquely identifies the instance ofBeanorContextual.Set<InjectionPoint>getInjectionPoints()Obtains theInjectionPointobjects representing injection points of the bean, that will be validated by the container at initialization time.StringgetName()Obtains the EL name of a bean, if it has one.Set<Annotation>getQualifiers()Obtains the qualifiers of the bean.Class<? extends Annotation>getScope()Obtains the scope of the bean.Set<Class<? extends Annotation>>getStereotypes()Obtains the stereotypes of the bean.Set<Type>getTypes()Obtains the bean types of the bean.booleanisAlternative()Determines if the bean is an alternative.booleanisNullable()StringtoString()
-
-
-
Constructor Detail
-
ValidatorFactoryBean
public ValidatorFactoryBean(BeanManager beanManager, ValidationProviderHelper validationProviderHelper)
-
-
Method Detail
-
getBeanClass
public Class<?> 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<ValidatorFactory>- Returns:
- the bean class
-
getInjectionPoints
public Set<InjectionPoint> 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<ValidatorFactory>- Returns:
- the set of injection points of the bean
-
getName
public String getName()
Description copied from interface:BeanAttributesObtains the EL name of a bean, if it has one.- Specified by:
getNamein interfaceBeanAttributes<ValidatorFactory>- Returns:
- the EL name
-
getQualifiers
public Set<Annotation> getQualifiers()
Description copied from interface:BeanAttributesObtains the qualifiers of the bean.- Specified by:
getQualifiersin interfaceBeanAttributes<ValidatorFactory>- Returns:
- the qualifiers
-
getScope
public Class<? extends Annotation> getScope()
Description copied from interface:BeanAttributesObtains the scope of the bean.- Specified by:
getScopein interfaceBeanAttributes<ValidatorFactory>- Returns:
- the scope
-
getStereotypes
public Set<Class<? extends Annotation>> getStereotypes()
Description copied from interface:BeanAttributesObtains the stereotypes of the bean.- Specified by:
getStereotypesin interfaceBeanAttributes<ValidatorFactory>- Returns:
- the set of stereotypes
-
getTypes
public Set<Type> getTypes()
Description copied from interface:BeanAttributesObtains the bean types of the bean.- Specified by:
getTypesin interfaceBeanAttributes<ValidatorFactory>- 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<ValidatorFactory>- Returns:
trueif the bean is an alternative, andfalseotherwise.
-
isNullable
public boolean isNullable()
-
create
public ValidatorFactory create(CreationalContext<ValidatorFactory> ctx)
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<ValidatorFactory>- Parameters:
ctx- the context in which this instance is being created- Returns:
- the contextual instance
-
destroy
public void destroy(ValidatorFactory instance, CreationalContext<ValidatorFactory> ctx)
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<ValidatorFactory>- Parameters:
instance- the contextual instance to destroyctx- the context in which this instance was created
-
getId
public String 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
-
-