users@jaxb.java.net

Loading classes as a JAXB-maven-plugin addon

From: Voß, Marko <Marko.Voss_at_fiz-Karlsruhe.de>
Date: Fri, 16 Mar 2012 16:28:21 +0000

Hello,

because of the last issue I have been asking on this mailing list
(Handling xs:any differently), I started to write my own
jaxb-maven-plugin addon.

The purpose of this addon is to add a DomHandler implementation to the
@XmlAnyElement annotation and changing the type of the any-property and
its getter/setter method.
This way I am able to change the result from org.w3c.dom.Element to any
other type like a stream class.

I am currently having a problem to load classes in this addon. The JAXB
maven-plugin is able to handle Java classes, which are either available
as source code or as compiled classes in the classpath of the maven
module. (maven dependencies)

outline.getCodeModel().ref(className)

returns a JDirectClass type (className is the name of the class defined
in the attribute of the element of this addon) and because of this
result has not been able to load the class. Manually tyring to load the
class fails as well.

I need to load the class to know the return type of the

DomHandler<T1, T2>.getElement(T2) method

which is T1.

How I can load classes as an addon?


best regards,


-------------------------------------------------------

Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische Information mbH.
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB 101892.
Geschäftsführerin: Sabine Brünger-Weilandt.
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.