use of javax.xml.bind.SchemaOutputResolver in project tomee by apache.
the class JAXBUtils method generateJaxbSchemas.
public static List<DOMResult> generateJaxbSchemas(JAXBContext context, final Map<String, DOMResult> builtIns) throws IOException {
final List<DOMResult> results = new ArrayList<>();
context.generateSchema(new SchemaOutputResolver() {
@Override
public Result createOutput(String ns, String file) throws IOException {
DOMResult result = new DOMResult();
if (builtIns.containsKey(ns)) {
DOMResult dr = builtIns.get(ns);
result.setSystemId(dr.getSystemId());
results.add(dr);
return result;
}
result.setSystemId(file);
results.add(result);
return result;
}
});
return results;
}
use of javax.xml.bind.SchemaOutputResolver in project cxf by apache.
the class JAXBUtils method generateJaxbSchemas.
public static List<DOMResult> generateJaxbSchemas(JAXBContext context, final Map<String, DOMResult> builtIns) throws IOException {
final List<DOMResult> results = new ArrayList<>();
context.generateSchema(new SchemaOutputResolver() {
@Override
public Result createOutput(String ns, String file) throws IOException {
DOMResult result = new DOMResult();
if (builtIns.containsKey(ns)) {
DOMResult dr = builtIns.get(ns);
result.setSystemId(dr.getSystemId());
results.add(dr);
return result;
}
result.setSystemId(file);
results.add(result);
return result;
}
});
return results;
}
use of javax.xml.bind.SchemaOutputResolver in project coprhd-controller by CoprHD.
the class SchemaApi method schema.
public static void schema() throws IOException {
final StringWriter writer = new StringWriter();
ApiModelPlugin.getInstance().getCtx().generateSchema(new SchemaOutputResolver() {
public Result createOutput(String namespaceUri, String filename) throws IOException {
Logger.debug("Generating API Schemas %s", filename);
StreamResult result = new StreamResult(writer);
result.setSystemId("schema.xsd");
return result;
}
});
renderXml(writer.toString());
}
Aggregations