ArrayList<JavaClass> extraClasses = new ArrayList<JavaClass>();
ArrayList<JavaClass> classesToProcess = new ArrayList<JavaClass>();
for (JavaClass jClass : classes) {
Class xmlElementType = null;
JavaClass javaClass = jClass;
TypeMappingInfo tmi = javaClassToTypeMappingInfos.get(javaClass);
if (tmi != null) {
Class adapterClass = this.typeMappingInfoToAdapterClasses.get(tmi);
if (adapterClass != null) {
JavaClass adapterJavaClass = helper.getJavaClass(adapterClass);
JavaClass newType = helper.getJavaClass(Object.class);
// look for marshal method
for (Object nextMethod : adapterJavaClass.getDeclaredMethods()) {
JavaMethod method = (JavaMethod) nextMethod;
if (method.getName().equals("marshal")) {
JavaClass returnType = method.getReturnType();
if (!returnType.getQualifiedName().equals(newType.getQualifiedName())) {
newType = (JavaClass) returnType;
break;
}
}
}
javaClass = newType;
}
java.lang.annotation.Annotation[] annotations = getAnnotations(tmi);
if (annotations != null) {
for (int j = 0; j < annotations.length; j++) {
java.lang.annotation.Annotation nextAnnotation = annotations[j];
if (nextAnnotation != null) {
if (nextAnnotation instanceof XmlElement) {
XmlElement javaAnnotation = (XmlElement) nextAnnotation;
if (javaAnnotation.type() != XmlElement.DEFAULT.class) {
xmlElementType = javaAnnotation.type();
}
}
}
}
}
}
if (areEquals(javaClass, byte[].class) || areEquals(javaClass, Byte[].class) || areEquals(javaClass, JAVAX_ACTIVATION_DATAHANDLER) || areEquals(javaClass, Source.class) || areEquals(javaClass, Image.class) || areEquals(javaClass, JAVAX_MAIL_INTERNET_MIMEMULTIPART)) {
if (tmi == null || tmi.getXmlTagName() == null) {
ElementDeclaration declaration = new ElementDeclaration(null, javaClass, javaClass.getQualifiedName(), false, XmlElementDecl.GLOBAL.class);
declaration.setTypeMappingInfo(tmi);
getGlobalElements().put(null, declaration);
}
} else if (javaClass.isArray()) {