}
JavaPackage pack = javaClass.getPackage();
// handle package level adapters (add them to the type info for this class)
if (helper.isAnnotationPresent(pack, XmlJavaTypeAdapters.class)) {
XmlJavaTypeAdapters adapters = (XmlJavaTypeAdapters) helper.getAnnotation(pack, XmlJavaTypeAdapters.class);
XmlJavaTypeAdapter[] adapterArray = adapters.value();
for (XmlJavaTypeAdapter next : adapterArray) {
JavaClass adapterClass = helper.getJavaClass(next.value());
JavaClass boundType = helper.getJavaClass(next.type());
if (boundType != null) {
info.addAdapterClass(adapterClass, boundType);
} else {
// TODO: Throw an error?
}
}
}
// handle class level adapters (add them to the type info for this class)
if (helper.isAnnotationPresent(javaClass, XmlJavaTypeAdapters.class)) {
XmlJavaTypeAdapters adapters = (XmlJavaTypeAdapters) helper.getAnnotation(javaClass, XmlJavaTypeAdapters.class);
XmlJavaTypeAdapter[] adapterArray = adapters.value();
for (XmlJavaTypeAdapter next : adapterArray) {
JavaClass adapterClass = helper.getJavaClass(next.value());
JavaClass boundType = helper.getJavaClass(next.type());
if(boundType != null) {
info.addAdapterClass(adapterClass, boundType);