|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.seam.solder.reflection.annotated.AnnotatedTypeBuilder<X>
public class AnnotatedTypeBuilder<X>
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 Summary | |
|---|---|
AnnotatedTypeBuilder()
Create a new builder. |
|
| Method Summary | ||
|---|---|---|
AnnotatedTypeBuilder<X> |
addToClass(Annotation annotation)
Add an annotation to the type declaration. |
|
AnnotatedTypeBuilder<X> |
addToConstructor(AnnotatedConstructor<X> constructor,
Annotation annotation)
Add an annotation to the specified constructor. |
|
AnnotatedTypeBuilder<X> |
addToConstructor(Constructor<X> constructor,
Annotation annotation)
Add an annotation to the specified constructor. |
|
AnnotatedTypeBuilder<X> |
addToConstructorParameter(Constructor<X> constructor,
int position,
Annotation annotation)
Add an annotation to the specified constructor parameter. |
|
AnnotatedTypeBuilder<X> |
addToField(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(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. |
|
AnnotatedTypeBuilder<X> |
addToParameter(AnnotatedParameter<? super X> parameter,
Annotation annotation)
Add an annotation to the specified parameter. |
|
AnnotatedType<X> |
create()
Create an AnnotatedType. |
|
Class<X> |
getJavaClass()
|
|
protected void |
mergeAnnotationsOnElement(Annotated annotated,
boolean overwriteExisting,
AnnotationBuilder typeAnnotations)
|
|
AnnotatedTypeBuilder<X> |
overrideConstructorParameterType(Constructor<X> constructor,
int position,
Type type)
Override the declared type of a constructor parameter |
|
void |
overrideFieldType(AnnotatedField<? super X> field,
Type type)
Override the declared type of a field |
|
void |
overrideFieldType(Field field,
Type type)
Override the declared type of a field |
|
AnnotatedTypeBuilder<X> |
overrideMethodParameterType(Method method,
int position,
Type type)
Override the declared type of a method parameter |
|
AnnotatedTypeBuilder<X> |
overrideParameterType(AnnotatedParameter<? super X> parameter,
Type type)
|
|
AnnotatedTypeBuilder<X> |
readFromType(AnnotatedType<X> type)
Reads in from an existing AnnotatedType. |
|
AnnotatedTypeBuilder<X> |
readFromType(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. |
|
|
redefine(Class<A> annotationType,
AnnotationRedefiner<A> redefinition)
Redefine any annotations of the specified type. |
|
protected
|
redefineAnnotationBuilder(Class<A> annotationType,
AnnotationRedefiner<A> redefinition,
AnnotatedElement annotated,
Type baseType,
AnnotationBuilder builder,
String elementName)
|
|
AnnotatedTypeBuilder<X> |
removeFromAll(Class<? extends Annotation> annotationType)
Remove annotations from the type, and all of it's members. |
|
AnnotatedTypeBuilder<X> |
removeFromClass(Class<? extends Annotation> annotationType)
Remove an annotation from the type |
|
AnnotatedTypeBuilder<X> |
removeFromConstructor(AnnotatedConstructor<X> constructor,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified constructor. |
|
AnnotatedTypeBuilder<X> |
removeFromConstructor(Constructor<X> constructor,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified constructor. |
|
AnnotatedTypeBuilder<X> |
removeFromConstructorParameter(Constructor<X> constructor,
int position,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified constructor parameter. |
|
AnnotatedTypeBuilder<X> |
removeFromField(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(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. |
|
AnnotatedTypeBuilder<X> |
removeFromParameter(AnnotatedParameter<? super X> parameter,
Class<? extends Annotation> annotationType)
Remove an annotation from the specified parameter. |
|
AnnotatedTypeBuilder<X> |
setJavaClass(Class<X> javaClass)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AnnotatedTypeBuilder()
readFromType(AnnotatedType),
readFromType(Class),
readFromType(AnnotatedType, boolean),
readFromType(Class, boolean)| Method Detail |
|---|
public AnnotatedTypeBuilder<X> addToClass(Annotation annotation)
annotation - the annotation instance to add
IllegalArgumentException - if the annotation is nullpublic AnnotatedTypeBuilder<X> removeFromClass(Class<? extends Annotation> annotationType)
annotationType - the annotation type to remove
IllegalArgumentException - if the annotationType
public AnnotatedTypeBuilder<X> addToField(Field field,
Annotation annotation)
field - the field to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> addToField(AnnotatedField<? super X> field,
Annotation annotation)
field - the field to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> removeFromField(Field field,
Class<? extends Annotation> annotationType)
field - the field to remove the annotation fromannotationType - the annotation type to remove
IllegalArgumentException - if the annotationType is null or if the
field is not currently declared on the type
public AnnotatedTypeBuilder<X> removeFromField(AnnotatedField<? super X> field,
Class<? extends Annotation> annotationType)
field - the field to remove the annotation fromannotationType - the annotation type to remove
IllegalArgumentException - if the annotationType is null or if the
field is not currently declared on the type
public AnnotatedTypeBuilder<X> addToMethod(Method method,
Annotation annotation)
method - the method to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> addToMethod(AnnotatedMethod<? super X> method,
Annotation annotation)
method - the method to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> removeFromMethod(Method method,
Class<? extends Annotation> annotationType)
method - the method to remove the annotation fromannotationType - the annotation type to remove
IllegalArgumentException - if the annotationType is null or if the
method is not currently declared on the type
public AnnotatedTypeBuilder<X> removeFromMethod(AnnotatedMethod<? super X> method,
Class<? extends Annotation> annotationType)
method - the method to remove the annotation fromannotationType - the annotation type to remove
IllegalArgumentException - if the annotationType is null or if the
method is not currently declared on the type
public 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 add
IllegalArgumentException - if the annotation is null
public 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 remove
IllegalArgumentException - if the annotationType is null, if the
method is not currently declared on the type or if the
parameter is not declared on the method
public AnnotatedTypeBuilder<X> addToConstructor(Constructor<X> constructor,
Annotation annotation)
constructor - the constructor to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> addToConstructor(AnnotatedConstructor<X> constructor,
Annotation annotation)
constructor - the constructor to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> removeFromConstructor(Constructor<X> constructor,
Class<? extends Annotation> annotationType)
constructor - the constructor to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotationType is null or if the
constructor is not currently declared on the type
public AnnotatedTypeBuilder<X> removeFromConstructor(AnnotatedConstructor<X> constructor,
Class<? extends Annotation> annotationType)
constructor - the constructor to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotationType is null, if the
annotation does not exist on the type or if the constructor is
not currently declared on the type
public AnnotatedTypeBuilder<X> addToConstructorParameter(Constructor<X> constructor,
int position,
Annotation annotation)
method - the constructor to add the annotation toposition - the position of the parameter to addannotation - the annotation to add
IllegalArgumentException - if the annotation is null
public AnnotatedTypeBuilder<X> removeFromConstructorParameter(Constructor<X> constructor,
int position,
Class<? extends Annotation> annotationType)
method - the constructor to remove the annotation fromposition - the position of the parameter to removeannotationType - the annotation type to remove
IllegalArgumentException - if the annotationType is null, if the
constructor is not currently declared on the type or if the
parameter is not declared on the constructor
public AnnotatedTypeBuilder<X> removeFromParameter(AnnotatedParameter<? super X> parameter,
Class<? extends Annotation> annotationType)
parameter - the parameter to remove the annotation fromannotationType - the annotation type to remove
IllegalArgumentException - if the annotationType is null, if the
callable which declares the parameter is not currently declared
on the type or if the parameter is not declared on either a
constructor or a method
public AnnotatedTypeBuilder<X> addToParameter(AnnotatedParameter<? super X> parameter,
Annotation annotation)
parameter - the parameter to add the annotation toannotation - the annotation to add
IllegalArgumentException - if the annotation is null or if the
parameter is not declared on either a constructor or a methodpublic AnnotatedTypeBuilder<X> removeFromAll(Class<? extends Annotation> annotationType)
annotationType - the type of annotation to remove
IllegalArgumentException - if the annotationType is null
public <A extends Annotation> AnnotatedTypeBuilder<X> redefine(Class<A> annotationType,
AnnotationRedefiner<A> redefinition)
annotationType - the type of the annotation for which to call the
redefinitionredefinition - the redefiniton callback
IllegalArgumentException - if the annotationType or redefinition is
null
protected <A extends Annotation> void redefineAnnotationBuilder(Class<A> annotationType,
AnnotationRedefiner<A> redefinition,
AnnotatedElement annotated,
Type baseType,
AnnotationBuilder builder,
String elementName)
public AnnotatedTypeBuilder<X> readFromType(AnnotatedType<X> type)
type - the type to read from
IllegalArgumentException - if type is null
public AnnotatedTypeBuilder<X> readFromType(AnnotatedType<X> type,
boolean overwrite)
type - the type to read fromoverwrite - if true, the read annotation will replace any existing
annotation
IllegalArgumentException - if type is nullpublic AnnotatedTypeBuilder<X> readFromType(Class<X> type)
type - the type to read from
IllegalArgumentException - if type is null
public AnnotatedTypeBuilder<X> readFromType(Class<X> type,
boolean overwrite)
type - the type to read fromoverwrite - if true, the read annotation will replace any existing
annotation
protected void mergeAnnotationsOnElement(Annotated annotated,
boolean overwriteExisting,
AnnotationBuilder typeAnnotations)
public AnnotatedType<X> create()
AnnotatedType. Any public members present on the
underlying class and not overridden by the builder will be automatically
added.
public void overrideFieldType(Field field,
Type type)
field - the field to override the type ontype - the new type of the field
IllegalArgumentException - if field or type is null
public void overrideFieldType(AnnotatedField<? super X> field,
Type type)
field - the field to override the type ontype - the new type of the field
IllegalArgumentException - if field or type is null
public AnnotatedTypeBuilder<X> overrideMethodParameterType(Method method,
int position,
Type type)
method - the method to override the parameter type onposition - the position of the parameter to override the type ontype - the new type of the parameter
IllegalArgumentException - if parameter or type is null
public AnnotatedTypeBuilder<X> overrideConstructorParameterType(Constructor<X> constructor,
int position,
Type type)
constructor - the constructor to override the parameter type onposition - the position of the parameter to override the type ontype - the new type of the parameter
IllegalArgumentException - if parameter or type is null
public AnnotatedTypeBuilder<X> overrideParameterType(AnnotatedParameter<? super X> parameter,
Type type)
public Class<X> getJavaClass()
public AnnotatedTypeBuilder<X> setJavaClass(Class<X> javaClass)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||