use of org.apache.nifi.minifi.toolkit.configuration.dto.ConfigSchemaFunction in project nifi-minifi by apache.
the class ConfigMain method transformTemplateToSchema.
public static ConfigSchema transformTemplateToSchema(InputStream source) throws JAXBException, IOException {
try {
TemplateDTO templateDTO = (TemplateDTO) JAXBContext.newInstance(TemplateDTO.class).createUnmarshaller().unmarshal(source);
FlowSnippetDTOEnricher enricher = new FlowSnippetDTOEnricher();
enricher.enrich(templateDTO.getSnippet(), templateDTO.getEncodingVersion());
ConfigSchema configSchema = new ConfigSchemaFunction().apply(templateDTO);
return configSchema;
} finally {
source.close();
}
}
Aggregations