use of org.mule.runtime.module.extension.internal.capability.xml.schema.model.NamespaceFilter in project mule by mulesoft.
the class DefaultExtensionSchemaGenerator method renderSchema.
private String renderSchema(Schema schema) {
try {
JAXBContext jaxbContext = JAXBContext.newInstance(Schema.class);
Marshaller marshaller = jaxbContext.createMarshaller();
NamespaceFilter outFilter = new NamespaceFilter(CORE_PREFIX, CORE_NAMESPACE, true);
OutputFormat format = new OutputFormat();
format.setIndent(true);
format.setNewlines(true);
StringWriter sw = new StringWriter();
XMLWriter writer = new XMLWriter(sw, format);
outFilter.setContentHandler(writer);
marshaller.marshal(schema, outFilter);
return sw.toString();
} catch (JAXBException e) {
throw new RuntimeException(e);
}
}
Aggregations