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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondumpBeansAsYaml(CamelContext context, List<Object> beans) Dumps the beans as YAMLdumpDataFormatsAsYaml(CamelContext context, Map<String, Object> dataFormats) Dumps the global data formats as YAMLdumpModelAsYaml(CamelContext context, NamedNode definition) Dumps the definition as YAMLdumpModelAsYaml(CamelContext context, NamedNode definition, boolean resolvePlaceholders, boolean uriAsParameters, boolean generatedIds, boolean sourceLocation) Dumps the definition as YAML
-
Field Details
-
FACTORY
-
-
Method Details
-
dumpModelAsYaml
Dumps the definition as 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 CamelContextdefinition- the definition, such as aNamedNoderesolvePlaceholders- whether to resolve property placeholders in the dumped YAMLuriAsParameters- whether to expand uri into a key/value parametersgeneratedIds- whether to include auto generated IDssourceLocation- whether to include source location:line- Returns:
- the output in YAML (is formatted)
- Throws:
Exception- is throw if error marshalling to YAML
-
dumpBeansAsYaml
-
dumpDataFormatsAsYaml
Dumps the global data formats as YAML- Parameters:
context- the CamelContextdataFormats- list of data formats (DataFormatDefinition)- Returns:
- the output in YAML (is formatted)
- Throws:
Exception- is throw if error marshalling to YAML
-