Interface ModelToYAMLDumper


public interface ModelToYAMLDumper
SPI that serialises Camel route model definitions to their YAML DSL representation.

The implementation is provided by camel-yaml-io and discovered via the service key FACTORY. Callers supply a CamelContext and a NamedNode route definition; the dumper returns a formatted YAML string. The overloaded dumpModelAsYaml variant adds control over placeholder resolution, URI expansion into key-value parameters, 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:
4.0
See Also:
  • Field Details

  • Method Details

    • dumpModelAsYaml

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

      String dumpModelAsYaml(CamelContext context, NamedNode definition, boolean resolvePlaceholders, boolean uriAsParameters, boolean generatedIds, boolean sourceLocation) throws Exception
      Dumps the definition as YAML
      Parameters:
      context - the CamelContext
      definition - the definition, such as a NamedNode
      resolvePlaceholders - whether to resolve property placeholders in the dumped YAML
      uriAsParameters - whether to expand uri into a key/value parameters
      generatedIds - whether to include auto generated IDs
      sourceLocation - whether to include source location:line
      Returns:
      the output in YAML (is formatted)
      Throws:
      Exception - is throw if error marshalling to YAML
    • dumpBeansAsYaml

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

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