T
- the type of the Beanpublic class WrappingBeanBuilder<T> extends Object
A WrappingBeanBuilder helps creating Beans which internally just wrap another existing Bean. The Types, Qualifiers and other attributes of the resulting Bean can be modified.
The Contextual.create(javax.enterprise.context.spi.CreationalContext)
and Contextual.destroy(Object, javax.enterprise.context.spi.CreationalContext)
methods will get delegated to the underlying wrapped Bean.
Constructor and Description |
---|
WrappingBeanBuilder(javax.enterprise.inject.spi.Bean<Object> delegate,
javax.enterprise.inject.spi.BeanManager beanManager)
Instantiate a new
WrappingBeanBuilder . |
Modifier and Type | Method and Description |
---|---|
WrappingBeanBuilder<T> |
addQualifier(java.lang.annotation.Annotation qualifier)
Add to the qualifiers used for bean creation.
|
WrappingBeanBuilder<T> |
addQualifiers(java.lang.annotation.Annotation... qualifiers)
Add to the qualifiers used for bean creation.
|
WrappingBeanBuilder<T> |
addQualifiers(Collection<java.lang.annotation.Annotation> qualifiers)
Add to the qualifiers used for bean creation.
|
WrappingBeanBuilder<T> |
addType(Type type)
Add to the type closure used for bean creation.
|
WrappingBeanBuilder<T> |
addTypes(Collection<Type> types)
Add to the type closure used for bean creation.
|
WrappingBeanBuilder<T> |
addTypes(Type... types)
Add to the type closure used for bean creation.
|
WrappingBeanBuilder<T> |
alternative(boolean alternative)
Define that the created bean will (or will not) be an alternative.
|
ImmutableBeanWrapper<T> |
create()
Use the bean builder's current state to define the bean.
|
String |
getId()
The id currently defined for bean creation.
|
String |
getName()
The name of the bean currently defined for bean creation.
|
Set<java.lang.annotation.Annotation> |
getQualifiers()
Qualifiers currently defined for bean creation.
|
Class<? extends java.lang.annotation.Annotation> |
getScope()
Scope currently defined for bean creation.
|
Set<Class<? extends java.lang.annotation.Annotation>> |
getStereotypes()
Stereotypes currently defined for bean creation.
|
String |
getToString()
The string used when
Object.toString() is called on the bean. |
Set<Type> |
getTypes()
Type closure currently defined for bean creation.
|
WrappingBeanBuilder<T> |
id(String id)
Define the id used for bean creation.
|
boolean |
isAlternative()
Whether the created bean will be an alternative.
|
boolean |
isNullable()
Whether the created bean will be nullable.
|
boolean |
isPassivationCapable()
Whether the created bean will be passivation capable.
|
WrappingBeanBuilder<T> |
name(String name)
Define the name of the bean used for bean creation.
|
WrappingBeanBuilder<T> |
nullable(boolean nullable)
Define that the created bean will (or will not) be nullable.
|
WrappingBeanBuilder<T> |
passivationCapable(boolean passivationCapable)
Define that the created bean will (or will not) be passivation capable.
|
WrappingBeanBuilder<T> |
qualifiers(java.lang.annotation.Annotation... qualifiers)
Define the qualifiers used for bean creation.
|
WrappingBeanBuilder<T> |
qualifiers(Set<java.lang.annotation.Annotation> qualifiers)
Define the qualifiers used for bean creation.
|
WrappingBeanBuilder<T> |
readFromType(javax.enterprise.inject.spi.AnnotatedType<T> type)
Read the
AnnotatedType , creating a narrowing bean from the class
and its annotations. |
WrappingBeanBuilder<T> |
scope(Class<? extends java.lang.annotation.Annotation> scope)
Define the scope used for bean creation.
|
WrappingBeanBuilder<T> |
stereotypes(Set<Class<? extends java.lang.annotation.Annotation>> stereotypes)
Define the stereotypes used for bean creation.
|
WrappingBeanBuilder<T> |
toString(String toString)
Define the string used when
Object.toString() is called on the bean. |
WrappingBeanBuilder<T> |
types(Set<Type> types)
Define the type closure used for bean creation.
|
WrappingBeanBuilder<T> |
types(Type... types)
Define the type closure used for bean creation.
|
public WrappingBeanBuilder(javax.enterprise.inject.spi.Bean<Object> delegate, javax.enterprise.inject.spi.BeanManager beanManager)
WrappingBeanBuilder
.delegate
- the delegate beanbeanManager
- current bean-managerpublic WrappingBeanBuilder<T> readFromType(javax.enterprise.inject.spi.AnnotatedType<T> type)
Read the AnnotatedType
, creating a narrowing bean from the class
and its annotations.
type
- the type to readpublic Set<Type> getTypes()
public WrappingBeanBuilder<T> types(Set<Type> types)
types
- the type closure to usepublic WrappingBeanBuilder<T> types(Type... types)
types
- the type closure to usepublic WrappingBeanBuilder<T> addType(Type type)
type
- additional type to usepublic WrappingBeanBuilder<T> addTypes(Type... types)
types
- the additional types to usepublic WrappingBeanBuilder<T> addTypes(Collection<Type> types)
types
- the additional types to usepublic Set<java.lang.annotation.Annotation> getQualifiers()
public WrappingBeanBuilder<T> qualifiers(Set<java.lang.annotation.Annotation> qualifiers)
qualifiers
- the qualifiers to usepublic WrappingBeanBuilder<T> qualifiers(java.lang.annotation.Annotation... qualifiers)
qualifiers
- the qualifiers to usepublic WrappingBeanBuilder<T> addQualifier(java.lang.annotation.Annotation qualifier)
qualifier
- the additional qualifier to usepublic WrappingBeanBuilder<T> addQualifiers(java.lang.annotation.Annotation... qualifiers)
qualifiers
- the additional qualifiers to usepublic WrappingBeanBuilder<T> addQualifiers(Collection<java.lang.annotation.Annotation> qualifiers)
qualifiers
- the additional qualifiers to usepublic String getName()
null
if the bean has no namepublic WrappingBeanBuilder<T> name(String name)
name
- the name of the bean to use or null
if the bean
should have no namepublic Class<? extends java.lang.annotation.Annotation> getScope()
public WrappingBeanBuilder<T> scope(Class<? extends java.lang.annotation.Annotation> scope)
scope
- the scope to usepublic boolean isAlternative()
true
if the created bean will be an alternative,
otherwise false
public WrappingBeanBuilder<T> alternative(boolean alternative)
alternative
- true
if the created bean should be an
alternative, otherwise false
public Set<Class<? extends java.lang.annotation.Annotation>> getStereotypes()
public WrappingBeanBuilder<T> stereotypes(Set<Class<? extends java.lang.annotation.Annotation>> stereotypes)
stereotypes
- the stereotypes to usepublic ImmutableBeanWrapper<T> create()
Use the bean builder's current state to define the bean.
public String getToString()
Object.toString()
is called on the bean.public WrappingBeanBuilder<T> toString(String toString)
Object.toString()
is called on the bean.toString
- the string to usepublic boolean isNullable()
true
if the created bean will be nullable, otherwise
false
public WrappingBeanBuilder<T> nullable(boolean nullable)
nullable
- true
if the created bean should be nullable,
otherwise false
public boolean isPassivationCapable()
true
if the created bean will be passivation
capable, otherwise false
public WrappingBeanBuilder<T> passivationCapable(boolean passivationCapable)
passivationCapable
- true
if the created bean should be passivation
capable, otherwise false
public String getId()
public WrappingBeanBuilder<T> id(String id)
id
- the id to useCopyright © 2014 The Apache Software Foundation. All rights reserved.