Class TypedAnnotationWriter<A extends Annotation, W extends JAnnotationWriter<A>>
java.lang.Object
com.sun.codemodel.TypedAnnotationWriter<A,W>
- All Implemented Interfaces:
JAnnotationWriter<A>, InvocationHandler
class TypedAnnotationWriter<A extends Annotation, W extends JAnnotationWriter<A>>
extends Object
implements InvocationHandler, JAnnotationWriter<A>
Dynamically implements the typed annotation writer interfaces.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe annotation that we are writing.private Map<String, JAnnotationArrayMember> Keeps track of writers for array members.private final JAnnotationUseThis is what we are writing to.The type of the writer. -
Constructor Summary
ConstructorsConstructorDescriptionTypedAnnotationWriter(Class<A> annotation, Class<W> writer, JAnnotationUse use) -
Method Summary
Modifier and TypeMethodDescriptionprivate Objectprivate voidCheck if the type of the argument matches our expectation.(package private) static <W extends JAnnotationWriter<?>>
Wcreate(Class<W> w, JAnnotatable annotatable) Creates a new typed annotation writer.private WCreates a proxy and returns it.private static Class<? extends Annotation> findAnnotationType(Class<?> clazz) The type of the annotation that this writer is writing.Gets the underlying annotation use object to which we are writing.
-
Field Details
-
use
This is what we are writing to. -
annotation
The annotation that we are writing. -
writerType
The type of the writer. -
arrays
Keeps track of writers for array members. Lazily created.
-
-
Constructor Details
-
TypedAnnotationWriter
-
-
Method Details
-
getAnnotationUse
Description copied from interface:JAnnotationWriterGets the underlying annotation use object to which we are writing.- Specified by:
getAnnotationUsein interfaceJAnnotationWriter<A extends Annotation>
-
getAnnotationType
Description copied from interface:JAnnotationWriterThe type of the annotation that this writer is writing.- Specified by:
getAnnotationTypein interfaceJAnnotationWriter<A extends Annotation>
-
invoke
-
addArrayValue
-
checkType
-
createProxy
Creates a proxy and returns it. -
create
Creates a new typed annotation writer. -
findAnnotationType
-