}
Set contextSet = new HashSet();
for (Iterator iter = pContextList.iterator(); iter.hasNext(); ) {
Object o = iter.next();
TypeSG typeSG;
if (o instanceof ObjectSG) {
ObjectSG objectSG = ((ObjectSG) o);
typeSG = objectSG.getTypeSG();
generateCreateMethod(js, objectSG.getClassContext());
//NB: we don't have to check for duplicate element names since that would violate the XSD spec
} else if (o instanceof TypeSG) {
typeSG = (TypeSG) o;
} else {
continue;
}
if (typeSG.isComplex() && !contextSet.contains(typeSG)) {
// many global elements may have the same global complex type so must check first
generateCreateMethod(js, typeSG.getComplexTypeSG().getClassContext());
contextSet.add(typeSG);
}
}
return js;