*/
public void generateJavaSource(XSModel xsmodel, File dirloc, String packageName)
throws IOException
{
//Now that we have the schema, lets build the types for the schema
XSNamedMap xsnamedmap = xsmodel.getComponents(XSConstants.TYPE_DEFINITION);
int len = xsnamedmap != null ? xsnamedmap.getLength() : 0;
for (int i = 0; i < len; i++)
{
XSObject type = xsnamedmap.item(i);
if (type instanceof XSComplexTypeDefinition)
{
XSComplexTypeDefinition ctype = (XSComplexTypeDefinition)type;
//Ignore xsd:anyType
String nsuri = type.getNamespace();
String tname = type.getName();
if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
xsdJava.createJavaFile(ctype, dirloc, packageName, xsmodel);
}
else if (type instanceof XSSimpleTypeDefinition)
{
XSSimpleTypeDefinition stype = (XSSimpleTypeDefinition)type;
//Ignore xsd:anyType
String nsuri = type.getNamespace();
String tname = type.getName();
if (Constants.NS_SCHEMA_XSD.equals(nsuri) && "anyType".equals(tname)) continue;
xsdJava.createJavaFile(stype, dirloc, packageName, xsmodel);
}
}
//Consider Global Element Declarations that may have anonymous complex types
xsnamedmap = xsmodel.getComponents(XSConstants.ELEMENT_DECLARATION);
len = xsnamedmap != null ? xsnamedmap.getLength() : 0;
for (int i = 0; i < len; i++)
{
XSElementDeclaration elm = (XSElementDeclaration)xsnamedmap.item(i);
String elmname = elm.getName();
XSTypeDefinition elmtype = elm.getTypeDefinition();
if (elmtype != null && elmtype instanceof XSComplexTypeDefinition)
{
XSComplexTypeDefinition ctype = (XSComplexTypeDefinition)elmtype;