Interface ModelToJavaDumper


public interface ModelToJavaDumper
SPI that serialises Camel route model definitions to their Java DSL representation (source code).

The implementation is provided by camel-java-io and discovered via the service key FACTORY. Callers supply a CamelContext and a NamedNode route definition; the dumper returns a formatted Java source string. The overloaded dumpModelAsJava variant adds control over placeholder resolution and auto-generated ID inclusion. The primary consumers are camel-jbang export commands that convert running integrations into a Java DSL project.

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

Since:
4.21
See Also:
  • Field Details

  • Method Details

    • dumpModelAsJava

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

      String dumpModelAsJava(CamelContext context, NamedNode definition, boolean resolvePlaceholders, boolean generatedIds) throws Exception
      Dumps the definition as Java DSL
      Parameters:
      context - the CamelContext
      definition - the definition, such as a NamedNode
      resolvePlaceholders - whether to resolve property placeholders in the dumped Java DSL
      generatedIds - whether to include auto generated IDs
      Returns:
      the output in Java DSL (is formatted)
      Throws:
      Exception - is throw if error marshalling to Java DSL