public class AnnotatedTypeBuilder<X> extends Object
Class for constructing a new AnnotatedType. A new instance of builder should be used for each annotated type.
AnnotatedTypeBuilder
is not thread-safe.
AnnotatedType
Constructor and Description |
---|
AnnotatedTypeBuilder()
Create a new builder.
|
Modifier and Type | Method and Description |
---|---|
AnnotatedTypeBuilder<X> |
addToClass(Annotation annotation)
Add an annotation to the type declaration.
|
AnnotatedTypeBuilder<X> |
addToField(javax.enterprise.inject.spi.AnnotatedField<? super X> field,
Annotation annotation)
Add an annotation to the specified field.
|
AnnotatedTypeBuilder<X> |
addToField(Field field,
Annotation annotation)
Add an annotation to the specified field.
|
AnnotatedTypeBuilder<X> |
addToMethod(javax.enterprise.inject.spi.AnnotatedMethod<? super X> method,
Annotation annotation)
Add an annotation to the specified method.
|
AnnotatedTypeBuilder<X> |
addToMethod(Method method,
Annotation annotation)
Add an annotation to the specified method.
|
AnnotatedTypeBuilder<X> |
addToMethodParameter(Method method,
int position,
Annotation annotation)
Add an annotation to the specified method parameter.
|
javax.enterprise.inject.spi.AnnotatedType<X> |
create()
Create an
AnnotatedType . |
protected void |
mergeAnnotationsOnElement(javax.enterprise.inject.spi.Annotated annotated,
boolean overwriteExisting,
AnnotationBuilder typeAnnotations) |
AnnotatedTypeBuilder<X> |
readFromType(javax.enterprise.inject.spi.AnnotatedType<X> type)
Reads in from an existing AnnotatedType.
|
AnnotatedTypeBuilder<X> |
readFromType(javax.enterprise.inject.spi.AnnotatedType<X> type,
boolean overwrite)
Reads in from an existing AnnotatedType.
|
AnnotatedTypeBuilder<X> |
readFromType(Class<X> type)
Reads the annotations from an existing java type.
|
AnnotatedTypeBuilder<X> |
readFromType(Class<X> type,
boolean overwrite)
Reads the annotations from an existing java type.
|
AnnotatedTypeBuilder<X> |
removeFromClass(Class<? extends Annotation> annotationType)
Remove an annotation from the type
|
AnnotatedTypeBuilder<X> |
removeFromField(javax.enterprise.inject.spi.AnnotatedField<? super X> field,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified field.
|
AnnotatedTypeBuilder<X> |
removeFromField(Field field,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified field.
|
AnnotatedTypeBuilder<X> |
removeFromMethod(javax.enterprise.inject.spi.AnnotatedMethod<? super X> method,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified method.
|
AnnotatedTypeBuilder<X> |
removeFromMethod(Method method,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified method.
|
AnnotatedTypeBuilder<X> |
removeFromMethodParameter(Method method,
int position,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified method parameter.
|
public AnnotatedTypeBuilder()
public AnnotatedTypeBuilder<X> addToClass(Annotation annotation)
annotation
- the annotation instance to addIllegalArgumentException
- if the annotation is nullpublic AnnotatedTypeBuilder<X> readFromType(javax.enterprise.inject.spi.AnnotatedType<X> type)
type
- the type to read fromIllegalArgumentException
- if type is nullpublic AnnotatedTypeBuilder<X> readFromType(javax.enterprise.inject.spi.AnnotatedType<X> type, boolean overwrite)
type
- the type to read fromoverwrite
- if true, the read annotation will replace any existing
annotationIllegalArgumentException
- if type is nullpublic AnnotatedTypeBuilder<X> readFromType(Class<X> type)
type
- the type to read fromIllegalArgumentException
- if type is nullpublic AnnotatedTypeBuilder<X> readFromType(Class<X> type, boolean overwrite)
type
- the type to read fromoverwrite
- if true, the read annotation will replace any existing
annotationprotected void mergeAnnotationsOnElement(javax.enterprise.inject.spi.Annotated annotated, boolean overwriteExisting, AnnotationBuilder typeAnnotations)
public javax.enterprise.inject.spi.AnnotatedType<X> create()
AnnotatedType
. Any public members present on the
underlying class and not overridden by the builder will be automatically
added.public AnnotatedTypeBuilder<X> removeFromClass(Class<? extends Annotation> annotationType)
annotationType
- the annotation type to removeIllegalArgumentException
- if the annotationTypepublic AnnotatedTypeBuilder<X> removeFromMethod(Method method, Class<? extends Annotation> annotationType)
method
- the method to remove the annotation fromannotationType
- the annotation type to removeIllegalArgumentException
- if the annotationType is null or if the
method is not currently declared on the typepublic AnnotatedTypeBuilder<X> removeFromMethod(javax.enterprise.inject.spi.AnnotatedMethod<? super X> method, Class<? extends Annotation> annotationType)
method
- the method to remove the annotation fromannotationType
- the annotation type to removeIllegalArgumentException
- if the annotationType is null or if the
method is not currently declared on the typepublic AnnotatedTypeBuilder<X> addToMethod(Method method, Annotation annotation)
method
- the method to add the annotation toannotation
- the annotation to addIllegalArgumentException
- if the annotation is nullpublic AnnotatedTypeBuilder<X> addToMethod(javax.enterprise.inject.spi.AnnotatedMethod<? super X> method, Annotation annotation)
method
- the method to add the annotation toannotation
- the annotation to addIllegalArgumentException
- if the annotation is nullpublic AnnotatedTypeBuilder<X> addToMethodParameter(Method method, int position, Annotation annotation)
method
- the method to add the annotation toposition
- the position of the parameter to addannotation
- the annotation to addIllegalArgumentException
- if the annotation is nullpublic AnnotatedTypeBuilder<X> removeFromMethodParameter(Method method, int position, Class<? extends Annotation> annotationType)
method
- the method to remove the annotation fromposition
- the position of the parameter to removeannotationType
- the annotation type to removeIllegalArgumentException
- if the annotationType is null, if the
method is not currently declared on the type or if the
parameter is not declared on the methodpublic AnnotatedTypeBuilder<X> addToField(Field field, Annotation annotation)
field
- the field to add the annotation toannotation
- the annotation to addIllegalArgumentException
- if the annotation is nullpublic AnnotatedTypeBuilder<X> addToField(javax.enterprise.inject.spi.AnnotatedField<? super X> field, Annotation annotation)
field
- the field to add the annotation toannotation
- the annotation to addIllegalArgumentException
- if the annotation is nullpublic AnnotatedTypeBuilder<X> removeFromField(Field field, Class<? extends Annotation> annotationType)
field
- the field to remove the annotation fromannotationType
- the annotation type to removeIllegalArgumentException
- if the annotationType is null or if the
field is not currently declared on the typepublic AnnotatedTypeBuilder<X> removeFromField(javax.enterprise.inject.spi.AnnotatedField<? super X> field, Class<? extends Annotation> annotationType)
field
- the field to remove the annotation fromannotationType
- the annotation type to removeIllegalArgumentException
- if the annotationType is null or if the
field is not currently declared on the typeCopyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.