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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondumpBeansAsXml(CamelContext context, List<Object> beans) Dumps the beans as XMLdumpDataFormatsAsXml(CamelContext context, Map<String, Object> dataFormats) Dumps the global data formats as XMLdumpModelAsXml(CamelContext context, NamedNode definition) Dumps the definition as XMLdumpModelAsXml(CamelContext context, NamedNode definition, boolean resolvePlaceholders, boolean generatedIds, boolean sourceLocation) Dumps the definition as XML
-
Field Details
-
FACTORY
-
-
Method Details
-
dumpModelAsXml
-
dumpModelAsXml
String dumpModelAsXml(CamelContext context, NamedNode definition, boolean resolvePlaceholders, boolean generatedIds, boolean sourceLocation) throws Exception Dumps the definition as XML- Parameters:
context- the CamelContextdefinition- the definition, such as aNamedNoderesolvePlaceholders- whether to resolve property placeholders in the dumped XMLgeneratedIds- whether to include auto generated IDssourceLocation- whether to include source location:line- Returns:
- the output in XML (is formatted)
- Throws:
Exception- is throw if error marshalling to XML
-
dumpBeansAsXml
-
dumpDataFormatsAsXml
Dumps the global data formats as XML- Parameters:
context- the CamelContextdataFormats- list of data formats (DataFormatDefinition)- Returns:
- the output in XML (is formatted)
- Throws:
Exception- is throw if error marshalling to XML
-