* @throws IOException
*/
public static void writeSchemas(File dir, Collection schemas) throws JiBXException, IOException {
IBindingFactory fact = BindingDirectory.getFactory(SchemaUtils.XS_PREFIX_BINDING, SchemaElement.class);
for (Iterator iter = schemas.iterator(); iter.hasNext();) {
SchemaHolder holder = (SchemaHolder)iter.next();
if (!holder.isExistingFile()) {
IMarshallingContext ictx = fact.createMarshallingContext();
File file = new File(dir, holder.getFileName());
ictx.setOutput(new FileOutputStream(file), null);
ictx.setIndent(2);
((IMarshallable)holder.getSchema()).marshal(ictx);
ictx.getXmlWriter().flush();
}
}
}