Generating XML Schema from JAXB class files in Ant?

You could probably write something fairly easily, and then call it from Ant: public class SchemaGenerator { public static void main(String args) throws Exception { String contextPath = args0; String outputDir = args1; JAXBContext jc = JAXBContext. NewInstance(contextPath); jc. GenerateSchema(new MySchemaOutputResolver(schemaFileName)); } private static class MySchemaOuputResolver extends SchemaOutputResolver { private String outputDir; public MySchemaOutputResolver(String outputDir) { this.

OutputDir = outputDir; } public Result createOutput(String namespaceURI, String suggestedFileName) throws IOException { File file = new File(outputDir + "/" + suggestedFileName); StreamResult result = new StreamResult(file); result. SetSystemId(file.toURI().toURL().toString()); return result; } } } In your context path you would need a jaxb. Index file with a list of classes to be included in your JAXBContext.

Or you could pass the class names to the SchemaGenerator class and load them via a ClassLoader.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions