i am using jaxb to generate code from an xsd.
The generated code contains a lot of annotations; for classes and fields.
I am trying to use com.sun.tools.internal.xjc.Plugin
to modify the generated code.
In the plugin run()
method we are given an Outline
class from which we can get ClassOutline
. ClassOutline
has an JDefinedClass
final member which has the info about actual class which will be generated.
If i want to add anything, there are apis in JDefinedClass
which can be used. But if i want to remove something, there is no way.
e.g. i cannot clear annotations, because the JDefinedClass.annotations()
method returns an UnmodifiableCollection
. so i cannot clear it or remove anything from it.
i tried to create another JDefinedClass
by invoking the _class
method but the ClassOutline.implClass
variable is final, so i cannot set it.
how to get a JDefinedClass
which does not have any annotations?
is there another phase of code generation which i can trap into to really control the generation of JDefinedClass
?