Package com.sun.faces.cdi
Class ViewProducer
- java.lang.Object
-
- com.sun.faces.cdi.ViewProducer
-
- All Implemented Interfaces:
jakarta.enterprise.context.spi.Contextual<UIViewRoot>,jakarta.enterprise.inject.spi.Bean<UIViewRoot>,jakarta.enterprise.inject.spi.BeanAttributes<UIViewRoot>,jakarta.enterprise.inject.spi.PassivationCapable,Serializable
public class ViewProducer extends Object
The ViewProducer is the CDI producer that allows you to inject the UIViewRoot and to do EL resolving of #{view}
- Since:
- 2.3
- See Also:
UIViewRoot, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ViewProducer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.sun.faces.cdi.CdiProducer<T>addToId(Object object)protected com.sun.faces.cdi.CdiProducer<T>beanClass(Class<?> beanClass)protected com.sun.faces.cdi.CdiProducer<T>beanClassAndType(Class<?> beanClass)Tcreate(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)protected com.sun.faces.cdi.CdiProducer<T>create(Function<jakarta.enterprise.context.spi.CreationalContext<T>,T> create)voiddestroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)Destroy the instance.Class<?>getBeanClass()StringgetId()Get the ID of this particular instantiation of the producer.Set<jakarta.enterprise.inject.spi.InjectionPoint>getInjectionPoints()Get the injection points.StringgetName()Set<Annotation>getQualifiers()Get the default qualifier.Class<? extends Annotation>getScope()Set<Class<? extends Annotation>>getStereotypes()Get the stereotypes.Set<Type>getTypes()booleanisAlternative()Is this an alternative.booleanisNullable()protected com.sun.faces.cdi.CdiProducer<T>name(String name)protected com.sun.faces.cdi.CdiProducer<T>qualifiers(Annotation... qualifiers)protected com.sun.faces.cdi.CdiProducer<T>scope(Class<? extends Annotation> scope)protected com.sun.faces.cdi.CdiProducer<T>types(Type... types)
-
-
-
Method Detail
-
getId
public String getId()
Get the ID of this particular instantiation of the producer.This is an implementation detail of CDI, where it wants to relocate a particular producer in order to re-inject a value. This is typically used in combination with passivation. Note that this is NOT about the value we're producing, but about the producer itself.
- Specified by:
getIdin interfacejakarta.enterprise.inject.spi.PassivationCapable- Returns:
- the ID of this particular instantiation of the producer
-
getName
public String getName()
- Specified by:
getNamein interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getBeanClass
public Class<?> getBeanClass()
- Specified by:
getBeanClassin interfacejakarta.enterprise.inject.spi.Bean<T>
-
getTypes
public Set<Type> getTypes()
- Specified by:
getTypesin interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getQualifiers
public Set<Annotation> getQualifiers()
Get the default qualifier.- Specified by:
getQualifiersin interfacejakarta.enterprise.inject.spi.BeanAttributes<T>- Returns:
- the qualifiers, which in the default case only contains the Default
-
getScope
public Class<? extends Annotation> getScope()
- Specified by:
getScopein interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
create
public T create(jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)
- Specified by:
createin interfacejakarta.enterprise.context.spi.Contextual<T>
-
destroy
public void destroy(T instance, jakarta.enterprise.context.spi.CreationalContext<T> creationalContext)Destroy the instance.Since most artifact that the sub classes are producing are artifacts that the Faces runtime really is managing the destroy method here does not need to do anything.
- Specified by:
destroyin interfacejakarta.enterprise.context.spi.Contextual<T>- Parameters:
instance- the instance.creationalContext- the creational context.
-
getInjectionPoints
public Set<jakarta.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
Get the injection points.- Specified by:
getInjectionPointsin interfacejakarta.enterprise.inject.spi.Bean<T>- Returns:
- the injection points.
-
getStereotypes
public Set<Class<? extends Annotation>> getStereotypes()
Get the stereotypes.- Specified by:
getStereotypesin interfacejakarta.enterprise.inject.spi.BeanAttributes<T>- Returns:
- the stereotypes.
-
isAlternative
public boolean isAlternative()
Is this an alternative.- Specified by:
isAlternativein interfacejakarta.enterprise.inject.spi.BeanAttributes<T>- Returns:
- false.
-
isNullable
public boolean isNullable()
-
name
protected com.sun.faces.cdi.CdiProducer<T> name(String name)
-
create
protected com.sun.faces.cdi.CdiProducer<T> create(Function<jakarta.enterprise.context.spi.CreationalContext<T>,T> create)
-
beanClass
protected com.sun.faces.cdi.CdiProducer<T> beanClass(Class<?> beanClass)
-
types
protected com.sun.faces.cdi.CdiProducer<T> types(Type... types)
-
beanClassAndType
protected com.sun.faces.cdi.CdiProducer<T> beanClassAndType(Class<?> beanClass)
-
qualifiers
protected com.sun.faces.cdi.CdiProducer<T> qualifiers(Annotation... qualifiers)
-
scope
protected com.sun.faces.cdi.CdiProducer<T> scope(Class<? extends Annotation> scope)
-
addToId
protected com.sun.faces.cdi.CdiProducer<T> addToId(Object object)
-
-