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
Modifier and Type Method Description protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
addToId(Object object)
protected static <T> Set<T>
asSet(T... a)
protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
beanClass(Class<?> beanClass)
protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
beanClassAndType(Class<?> beanClass)
UIViewRoot
create(jakarta.enterprise.context.spi.CreationalContext<UIViewRoot> creationalContext)
protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
create(Function<jakarta.enterprise.context.spi.CreationalContext<UIViewRoot>,UIViewRoot> create)
void
destroy(UIViewRoot instance, jakarta.enterprise.context.spi.CreationalContext<UIViewRoot> creationalContext)
Destroy the instance.Class<?>
getBeanClass()
String
getId()
Get the ID of this particular instantiation of the producer.Set<jakarta.enterprise.inject.spi.InjectionPoint>
getInjectionPoints()
Get the injection points.String
getName()
Set<Annotation>
getQualifiers()
Get the default qualifier.Class<? extends Annotation>
getScope()
Set<Class<? extends Annotation>>
getStereotypes()
Get the stereotypes.Set<Type>
getTypes()
boolean
isAlternative()
Is this an alternative.boolean
isNullable()
Is this nullable.protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
name(String name)
protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
qualifiers(Annotation... qualifiers)
protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
scope(Class<? extends Annotation> scope)
protected com.sun.faces.cdi.CdiProducer<UIViewRoot>
types(Type... types)
-
Constructor Details
-
ViewProducer
public ViewProducer()
-
-
Method Details
-
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:
getId
in interfacejakarta.enterprise.inject.spi.PassivationCapable
- Returns:
- the ID of this particular instantiation of the producer
-
getName
- Specified by:
getName
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getBeanClass
- Specified by:
getBeanClass
in interfacejakarta.enterprise.inject.spi.Bean<T>
-
getTypes
- Specified by:
getTypes
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
getQualifiers
Get the default qualifier.- Specified by:
getQualifiers
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
- Returns:
- the qualifiers, which in the default case only contains the Default
-
getScope
- Specified by:
getScope
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
-
create
public UIViewRoot create(jakarta.enterprise.context.spi.CreationalContext<UIViewRoot> creationalContext)- Specified by:
create
in interfacejakarta.enterprise.context.spi.Contextual<T>
-
destroy
public void destroy(UIViewRoot instance, jakarta.enterprise.context.spi.CreationalContext<UIViewRoot> creationalContext)Destroy the instance.Since most artifact that the sub classes are producing are artifacts that the JSF runtime really is managing the destroy method here does not need to do anything.
- Specified by:
destroy
in interfacejakarta.enterprise.context.spi.Contextual<T>
- Parameters:
instance
- the instance.creationalContext
- the creational context.
-
getInjectionPoints
Get the injection points.- Specified by:
getInjectionPoints
in interfacejakarta.enterprise.inject.spi.Bean<T>
- Returns:
- the injection points.
-
getStereotypes
Get the stereotypes.- Specified by:
getStereotypes
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
- Returns:
- the stereotypes.
-
isAlternative
public boolean isAlternative()Is this an alternative.- Specified by:
isAlternative
in interfacejakarta.enterprise.inject.spi.BeanAttributes<T>
- Returns:
- false.
-
isNullable
public boolean isNullable()Is this nullable.- Specified by:
isNullable
in interfacejakarta.enterprise.inject.spi.Bean<T>
- Returns:
- false.
-
name
-
create
protected com.sun.faces.cdi.CdiProducer<UIViewRoot> create(Function<jakarta.enterprise.context.spi.CreationalContext<UIViewRoot>,UIViewRoot> create) -
beanClass
-
types
-
beanClassAndType
-
qualifiers
-
scope
-
addToId
-
asSet
-