Collection methods = objectFactoryClass.getDeclaredMethods();
Iterator methodsIter = methods.iterator();
PackageInfo packageInfo = getPackageInfoForPackage(objectFactoryClass);
while (methodsIter.hasNext()) {
JavaMethod next = (JavaMethod) methodsIter.next();
if (next.getName().startsWith(CREATE)) {
JavaClass type = next.getReturnType();
if (JAVAX_XML_BIND_JAXBELEMENT.equals(type.getName())) {
Object[] actutalTypeArguments = next.getReturnType().getActualTypeArguments().toArray();
if(actutalTypeArguments.length == 0) {
type = helper.getJavaClass(Object.class);
} else {
type = (JavaClass) next.getReturnType().getActualTypeArguments().toArray()[0];
}
} else {
this.factoryMethods.put(next.getReturnType().getRawName(), next);
}
// if there's an XmlElementDecl for this method from XML, use it
// - otherwise look for an annotation
org.eclipse.persistence.jaxb.xmlmodel.XmlRegistry.XmlElementDecl xmlEltDecl = elemDecls.get(next.getName());
if (xmlEltDecl != null || helper.isAnnotationPresent(next, XmlElementDecl.class)) {
QName qname;
QName substitutionHead = null;
String url;
String localName;