Interface ModelToXMLDumper


public interface ModelToXMLDumper
SPI that serialises Camel route model definitions to their XML DSL representation.

The implementation is provided by camel-xml-io and discovered via the service key FACTORY. Callers supply a CamelContext and a NamedNode route definition; the dumper returns a formatted XML string. The overloaded dumpModelAsXml variant adds control over placeholder resolution, auto-generated ID inclusion, and source-location metadata. Separate methods handle bean definitions and global data-format definitions. The primary consumers are camel-jbang export commands, the developer console, and CamelContext route-dump helpers.

See Camel CLI (camel-jbang) for the export commands that use this dumper.

Since:
3.1
See Also:
  • Field Details

  • Method Details

    • dumpModelAsXml

      String dumpModelAsXml(CamelContext context, NamedNode definition) throws Exception
      Dumps the definition as XML
      Parameters:
      context - the CamelContext
      definition - the definition, such as a NamedNode
      Returns:
      the output in XML (is formatted)
      Throws:
      Exception - is throw if error marshalling to XML
    • dumpModelAsXml

      String dumpModelAsXml(CamelContext context, NamedNode definition, boolean resolvePlaceholders, boolean generatedIds, boolean sourceLocation) throws Exception
      Dumps the definition as XML
      Parameters:
      context - the CamelContext
      definition - the definition, such as a NamedNode
      resolvePlaceholders - whether to resolve property placeholders in the dumped XML
      generatedIds - whether to include auto generated IDs
      sourceLocation - whether to include source location:line
      Returns:
      the output in XML (is formatted)
      Throws:
      Exception - is throw if error marshalling to XML
    • dumpBeansAsXml

      String dumpBeansAsXml(CamelContext context, List<Object> beans) throws Exception
      Dumps the beans as XML
      Parameters:
      context - the CamelContext
      beans - list of beans (BeanFactoryDefinition)
      Returns:
      the output in XML (is formatted)
      Throws:
      Exception - is throw if error marshalling to XML
    • dumpDataFormatsAsXml

      String dumpDataFormatsAsXml(CamelContext context, Map<String,Object> dataFormats) throws Exception
      Dumps the global data formats as XML
      Parameters:
      context - the CamelContext
      dataFormats - list of data formats (DataFormatDefinition)
      Returns:
      the output in XML (is formatted)
      Throws:
      Exception - is throw if error marshalling to XML