type = (JavaClass) next.getReturnType().getActualTypeArguments().toArray()[0];
} else {
this.factoryMethods.put(next.getReturnType().getRawName(), next);
}
if (helper.isAnnotationPresent(next, XmlElementDecl.class)) {
XmlElementDecl elementDecl = (XmlElementDecl) helper.getAnnotation(next, XmlElementDecl.class);
String url = elementDecl.namespace();
if ("##default".equals(url)) {
url = namespaceInfo.getNamespace();
}
String localName = elementDecl.name();
QName qname = new QName(url, localName);
if (this.globalElements == null) {
globalElements = new HashMap<QName, ElementDeclaration>();
}
boolean isList = false;
if ("java.util.List".equals(type.getName())) {
isList = true;
if (type.hasActualTypeArguments()) {
type = (JavaClass) type.getActualTypeArguments().toArray()[0];
}
}
ElementDeclaration declaration = new ElementDeclaration(qname, type, type.getQualifiedName(), isList, elementDecl.scope());
if (!elementDecl.substitutionHeadName().equals("")) {
String subHeadLocal = elementDecl.substitutionHeadName();
String subHeadNamespace = elementDecl.substitutionHeadNamespace();
if (subHeadNamespace.equals("##default")) {
subHeadNamespace = namespaceInfo.getNamespace();
}
declaration.setSubstitutionHead(new QName(subHeadNamespace, subHeadLocal));
}
if (!(elementDecl.defaultValue().length() == 1 && elementDecl.defaultValue().startsWith("\u0000"))) {
declaration.setDefaultValue(elementDecl.defaultValue());
}
if (helper.isAnnotationPresent(next, XmlJavaTypeAdapter.class)) {
XmlJavaTypeAdapter typeAdapter = (XmlJavaTypeAdapter) helper.getAnnotation(next, XmlJavaTypeAdapter.class);
Class typeAdapterClass = typeAdapter.value();