public JavaClass[] processObjectFactory(JavaClass objectFactoryClass, ArrayList<JavaClass> classes) {
Collection methods = objectFactoryClass.getMethods();
Iterator methodsIter = methods.iterator();
NamespaceInfo namespaceInfo = getNamespaceInfoForPackage(objectFactoryClass.getPackage());
while(methodsIter.hasNext()) {
JavaMethod next = (JavaMethod)methodsIter.next();
if(next.getName().startsWith("create")) {
if(!(next.getReturnType().getName().equals("javax.xml.bind.JAXBElement")) && !classes.contains(next.getReturnType())) {
classes.add(next.getReturnType());
} else {
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);
JavaClass type = (JavaClass)next.getReturnType().getActualTypeArguments().toArray()[0];
if(this.globalElements == null) {
globalElements = new HashMap<QName, ElementDeclaration>();
}
ElementDeclaration declaration = new ElementDeclaration(qname, type, type.getQualifiedName());
if(!elementDecl.substitutionHeadName().equals("")) {