Name

Marshal — Marshals data into a specified format for transmission over a transport or component

Usage

The Marshal pattern uses Apache Camel's pluggable data format mechanism to convert messages to a format appropriate for transmission by one of the Apache Camel components.

The Marshal pattern can be placed anywhere in the body of a route. However, it is typically placed before endpoints that transmit the message to another location.

Properties

Table 52 describes the properties you can specify using the properties editor.

Table 52. Marshal Properties

NameDescription
Data Format Type

Specifies the data type into which the data will be marshalled. For data formats that require configuration, the format's tab provides the property fields to configure the marshaller.

Because the GZip, Serialization, String, and Zip data formats are part of the Camel core, you need not add dependencies for them in your Maven pom.xml file to use them. However, to use any of the other supported data formats, you must add a dependency on the component that implements the data format (for example, camel-protobuf, camel-xmlbeans, camel-flatpack, camel-base64, camel-ical,camel-xmlrpc, camel-zipfile, and so on) in your Maven pom.xml file.

  • avro— Marshals Java Objects into the Apache Avro binary data format using a user-supplied schema that defines message types and a protocol.

  • base64— Encodes messages in base64 data format

  • beanio— Marshals Java Objects into flat data structures according to a user-defined mapping

  • bindy— Marshals Java Objects into flat data structures

  • castor—Marshals Java Objects to XML

  • crypto—Marshals Java Objects to encrypted cyphertext

  • csv—Marshals Java Objects to csv format

  • custom—Marshals Java Objects to a custom data format implemented using the DataFormat interface

  • flatpack—Marshals Java Objects to fixed-width or delimited text messages

  • gzip—Marshals normal, uncompressed messages to gzipped compressed messages

  • hl7—Marshals HL7 HAPI message objects to byte streams

  • ical—Marshals Java Objects to ICalendar message objects

  • jaxb—Marshals Java Objects to XML

  • jibx—Marshals Java Objects to XML using the JiBX library

  • json—Marshals Java Objects to JSON

  • pgp—Marshals Java Objects to encrypted cyphertext

  • protobuf—Marshals Java Objects to Protocol Buffers format (Google's data exchange format)

  • rss—Marshals ROME SyndFeed messages to XML String messages

  • secureXML—Marshals plain XML to encrypted XML. This data format works at the document, element, and element content levels.

  • serialization—Marshals Java Objects to a binary blob using the standard Java serialization mechanism

  • soapjaxb—Marshals a tree of Java Objects to a SOAP message using JAXB and JAX-WS annotations

  • string—Marshals XML or text-based messages to String Objects

  • syslog—Marshals Java String Objects to RFC3164 message format

  • univocity-csv—Marshals Java String Objects to csv data format

  • univocity-fixed—Marshals Java String Objects to fixed-width data format

  • univocity-tsv—Marshals Java String Objects to tabulated data format

  • xmlbeans—Marshals Java objects to XML using the XmlBeans library

  • xmljson—Marshals XML directly to Json

  • xmlrpc—Marshals xml messages into rpc request/response messages using Apache XmlRpc bindary format

  • xstream—Marshals Java objects to XML using the XStream library

  • zip—Marshals normal, uncompressed messages to zipped compressed messages

  • zipFile—Marshals (compresses) messages to zip files containing a single entry. Supports ZIP64 format when Java 7 or later is used

Description Specifies a text description for the node. This description is included in the generated XML file, but it is informational only. It is not used by Apache Camel.
Id

Specifies a unique identifier for the endpoint.

The tooling automatically generates an id for a node when it is created, but you can remove that id or replace it with your own. The Camel debugger requires all nodes with a breakpoint set to have a unique id.

You can use the id to refer to endpoints in your Camel XML file.

Ref Specifies a reference to a Spring bean configuring the Apache Camel data format to which the message body is marshalled.

avro

Table 53 describes the properties needed to configure the avro marshaller.

Table 53. avro Properties

NameDescription
Instance Class Name Specifies the name of the instance class to use for marshalling. This is the class defined by your schema .apache.camel.dataformat.avro.<nameOfInstanceClass>.

base64

Table 54 describes the properties needed to configure the base64 marshaller.

Table 54. base64 Properties

NameDefaultDescription
Line Length 76

Specifies the maximum line length.

Line Separator \r\n

Specifies the line separator to use.

Url Safe Disabled When disabled, encodes - and _. When enabled, encodes + (not -) and / (not _).

beanio

Table 55 describes the properties needed to configure the beanio marshaller.

Table 55. beanio Properties

NameDescription
Encoding

Specifies the charset to use. The default is platform-specific.

Ignore Invalid Records

Species whether to ignore invalid records. The default is false.

Ignore Unexpected Records Species whether to ignore invalid records. The default is false.
Ignore Unidentified Records Species whether to ignore invalid records. The default is false.
Mapping Specifies the BeanIO mapping.xml file to use. By default, this file is loaded from the classpath, but you can add one of the prefixes—file:, http:, or classpath:—to specify the location from which to load this file.
Stream Name Specifies the name of the stream to use.

bindy

Table 56 describes the properties needed to configure the bindy marshaller.

Table 56. bindy Properties

NameDescription
Class Type

Specifies a fully qualified class name that explicitly defines the type to use for marshalling. For example, you might enter com.mycompany.MyOrder

You must use either this property or Packages, but not both.

Locale

Species the language name of the locale whose date and number format will be used. If not specified, the marshaller determines and uses the formatting of a default language name. Valid values are the two-letter abbreviation of the language name, in lower case. For example,

  • default—platform default local

  • ar—Arabic

  • es—Castilian Spanish

  • da—Danish

  • en—English

  • fr—French

  • jp—Japanese

For an exhaustive list of language names, see Codes for the Representation of Names of Languages

Packages

Specifies the packages to use for marshalling. A package contains a defined model with required annotations properly associated for each class in the model. For example, you might enter com.mycompany.

When specifying multiple packages, separate them with a comma (,).

You must use either this property or Class Type, but not both.

Type Specifies the record type, Select either Csv (comma-separated value fields), Fixed (fixed-length records), or KeyValue (key/value pair fields).

castor

Table 57 describes the properties needed to configure the castor marshaller.

Table 57. castor Properties

NameDescription
Classes Specifies additional classes to add to the Castor XmlContext. Enter the fully qualified path. When specifying multiple classes, separate them with a comma (,).
Encoding Specifies the encoding to use when marshalling an Object to XML. Default is UTF-8.
Mapping File Specifies the path to the Castor mapping file to load from the classpath.
Packages Specifies any additional packages to add to the Castor XmlContext. Enter the fully qualified path. When specifying multiple classes, separate them with a comma (,).
Validation Enables/disables validation. The default is Disabled.

crypto

Table 58 describes the properties needed to configure the crypto marshaller.

Table 58. crypto Properties

NameDescription
Algorithm Specifies the name of the JCE cryptographic algorithm to use. Default is DES/CBC/PKCS5Padding.
Algorithm Parameter Ref Specifies a reference to the JCE AlgorithmParameterSpec to use to initialize the cipher. Some crypto algorithms, particularly block algorithms, require initialization by an initial block of data, known as an Initialization Vector. The JCE passes the Initialization Vector to the cipher as an AlgorithmParameterSpec . Select from the list of available options.
Buffersize Specifies the size, in bytes, of the buffer used in the signature process.
Crypto Provider Specifies the name of the JCE Security Provider to use. For options, see Java Cryptography Architecture; Sun Providers Documentation.
Init Vector Ref Specifies a reference to a byte array containing the Initialization Vector to use to initialize the cipher. Select from the list of available options.
Inline Enables inlining the configured Initialization Vector into the encrypted data stream.
Key Ref Specifies the value of the keyref attribute within the <dataFormats> element in a Spring configuration. For example, <crypto id="basic" algorithm="DES" keyref="desKey" />. Select from the list of available options.
Mac Algorithm Specifies the algorithm to use to create the Hash-based Message Authentication. Default is HmacSHA1. For more options, see Java Standard Names Reference.
Should Append HMAC Enables calculating and appending a Message Authentication Code to the encrypted data.

csv

Table 59 describes the properties needed to configure the csv marshaller.

Table 59. csv Properties

NameDescription
Allow Missing Column Names

Specifies whether to allow missing column names in the header line.

The default is Disabled for formats DEFAULT, RFC4180, MYSQL, and TDF, but True for EXCEL. (See Format Name for available reference formats.)

Comment Marker

Specifies the character to use to mark the start of a comment line.

The default is null.

Comment Marker Disabled Disables the comment marker of the reference format. The default is False.
Delimiter

Specifies the character to use for the value delimiter, typically ,, ;, or \t. The line break character causes an IllegalArguementException.

The default is , for formats DEFAULT, RFC4180, and EXCEL, but \t for MYSQL and TDF. (See Format Name for available reference formats.)

Escape

Specifies the character to use as the escape character.

The default is null, except for MYSQL, for which the default is \\. (See Format Name for available reference formats.)

Escape Disabled Disables the processing of escape characters. The default is False.
Format Name

Specifies the name of the reference format to use for parsing input. Predefined reference format options are:

  • CSVFormat.DEFAULT—[Default] Standard comma-separated format, but allows empty lines

  • CSVFormat.EXCEL—Excel file format, which typically uses the comma (,) as the value delimiter. Note that the value of the value delimiter is locale-dependent and depends on the system's regional settings.

  • CSVFormat.MYSQL—Default MySQL format used by the SELECT INTO OUTFILE and LOAD DATA INFILE operations

  • CSVFormat.RFC4180—Comma-separated format as defind by RFC 4180, which does allow empty lines

  • CSVFormat.TDF—Tab-delimited format, which uses the LF character as line separator

Format Ref Reference to a custom reference format.
Header

Specifies the column to use to address values in the CSV records. If your CSV source contains a first record that also defines column names, enable the Skip Header Record property.

The default is null.

Header Disabled Disables processing of the column names specified in the Header property.
Ignore Empty Lines

Specifies whether empty lines between records are ignored or turned into empty records.

The default is False for formats RFC4180, EXCEL, MYSQL and TDF, which results in empty lines becoming empty records, but True for DEFAULT, which results in empty lines being ignored. (See Format Name for available reference formats.)

Ignore Surrounding Spaces

Specifies whether spaces surrounding values are trimmed or included as part of the value.

The default is False for formats DEFAULT, RFC4180, EXCEL, and MYSQL, which results in including empty spaces with values, but True for TDF, which results in empty lines being ignored/trimmed. (See Format Name for available reference formats.)

Lazy Load Not applicable. Specifies whether the unmarshaller should use an iterator to read lines on-the-fly as needed. The default is False, which specifies eager loading/reading all lines at once.
Null String Specifies the string to use to convert to and from null on input and output. If left unspecified, the null string representation of the reference format is used.
Null String Disabled Disables null string processing. The default is False.
Quote Specifies the character to use to encapsulate values containing special characters. If not specified, uses the default character of the reference format, which is double quotes (") for all reference formats, except MYSQL, for which it is null. (See Format Name for available reference formats.)
Quote Disabled Disables quote processing. The default is False.
Record Converter Ref

Not applicable. Specifies a reference to the record converter to use for unmarshalling when Use Maps is Disabled.

The default is null.

Record Separator

Specifies the character or characters to use for the record separator. If not specified, uses the default of the reference format.

The default is \r\n for formats DEFAULT, RFC4180, EXCEL, and TDF, but \n for MYSQL. (See Format Name for available reference formats.)

Record Separator Disabled Disables processing of the record separator. The default is False.
Skip Header Record Specifies whether to skip the header record in the input file. Enable this property if you define your own column headers using the Header property. The default is False.
Use Maps

Not applicable. Specifies whether the unmarshaller produces maps, instead of lists, for line values. When enabled, the input must have a header line (either defined or collected).

The default is False.


custom

Table 60 describes the properties needed to configure the custom marshaller.

Table 60. custom Properties

NameDescription
Ref Reference to file that implements your custom data format using the DataFormat interface.

flatpack

Table 61 describes the properties needed to configure the jaxb marshaller.

Table 61. flatpack Properties

NameDescription
Allow Short Lines Specifies whether to allow lines to be shorter than expected and to ignore the extra characters. The default is Disabled.
Definition

Specifies the flatpack pzmap configuration file to use to configure the structure of the input. If not specified, the configuration of the input defaults to Delimited.

Delimiter Specifies the character to use to delimit values in the input for delimited input. The default is ,.
Fixed Specifies whether the input format is delimited or fixed-length. The default is Delimited.
Ignore Extra Columns Specifies whether to allow lines to be longer than expected and to ignore the extra characters. The default is Disabled.
Ignore First Record Specifies whether to ignore the first line (containing headers) for delimited input. The default is Disabled.
Parse Factory Ref Specifies the parser factory to use. If not specified, the default Flatpack parser factory is used.
Text Qualier Specifies the character to use to encapsulate text. The default is double quotes (").

ical

Table 62 describes the properties needed to configure the ical marshaller.

Table 62. ical Properties

NameDescription
Validating Specifies whether to enable validation checking. The default is Disabled.

jaxb

Table 63 describes the properties needed to configure the jaxb marshaller.

Table 63. jaxb Properties

NameDescription
Context Path Specifies the context path for the jaxb data format. For example, org.apache.camel.example
Encoding

Specifies the encoding to use when marshalling data. Valid values include:

  • ISO-8859-1

  • US-ASCII

  • UTF-8

With no value specified, Red Hat JBoss Fuse Tooling for Eclipse defaults to the encoding used by JAXB.

Filter Non XML Chars Enables the filtering of non XML characters during marshalling such that the marshaller replaces any non-XML characters it encounters with the string " ". Otherwise, when it encounters a non-XML character, the marshaller throws an exception. The default is Disabled.
Fragment Enables the marshaller's FRAGMENT encoding property, which prevents the marshaller from generating the XML declaration. Enable this property in conjunction with setting Part Class and Part Namespace to perform partial marshalling on only a fragment of the XML tree. The default is Disabled.
Ignore JAXBElement Not applicable. Specifies whether the unmarshalled message body contains the element instance value or the JAXBElement object. Enable this property to get the element instance value. The default is Disabled.
Must Be JAXBElement Specifies whether the Marshaller relaxes message checking for JAXB compatibility to marshal XML messages as is. To enable relaxed message checking, disable this property. The default is Enabled..
Namespace Prefix Ref

Specifies the id of the <util:map> that contains custom namespace mapping specifications.

The JAXB implementation auto assigns namespace prefixes (such as n1,n2, n3,...) to namespaces when marshalling JAXB or SOAP. To use your own custom prefixes or to eliminate prefixes, you need to create and reference a <util:map> in your camelContext. For example:

<util:map id="myMap">
 <!-- Assign the prefix soap to the soap namespace -->   
   <entry key="http://www.w3.org/2003/05/soap-envelope" value="soap" />
 <!-- Eliminate any prefix from our own namespace -->
   <entry key="http://www.mycompny.com/foo/2" value="" />
</util:map>
Part Class Specifies the uri of the class within the XML tree that you want to marshal, leaving all other classes in the tree as is. Set this property in conjunction with Fragment and Part Namespace to perform partial marshalling on only a fragment of the XML tree.
Part Namespace Specifies the Qname of the destination namespace.
Pretty Print Enables pretty printing, which adds white space as needed to tidy up the resulting XML for easy reading. The default is Disabled.
Schema Not applicable. Specifies the schema to use for validation when unmarshalling. To use multiple schemas, separate them using commas (,). Use the classpath:, file:, or http: prefix to specify how to resolve a specific resource.
Schema Location Not applicable. Specifies the location of the schema to use for validation when unmarshalling XML (for example, schema/person.xsd).
Xml Stream Writer Wrapper Specifies the name of XMLStreamWriterWrapper to use to marshal the stream to XML. Using the XMLStreamWriterWrapper to customize the XMLStreamWriter, you can remove, escape, or replace non-XML characters.

json

Table 64 describes the properties needed to configure the json marshaller.

Table 64. json Properties

NameDescription
Allow Jms Type Not applicable. For JMS destinations. Specifies whether to allow unmarshalling from Json to POJO using dynamic class names. To implement, you use the JMS message header JMSType to specify the class name to which to unmarshal. Requires the Jackson library. The default is Disabled.
Collection Type Name Specifies a reference to the name of a custom collection type in the Camel registry to use, instead of the default, which is based on java.util.Collection.
Disable Features Specifies the name or names of features to disable on the com.fasterxml.jackson.databind.ObjectMapper. Names must match an enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature. When specifying multiple features, separate them with a comma. Requires the Jackson library.
Enable Features Specifies the name or names of features to enable on the com.fasterxml.jackson.databind.ObjectMapper. Names must match an enum from com.fasterxml.jackson.databind.SerializationFeature, com.fasterxml.jackson.databind.DeserializationFeature, or com.fasterxml.jackson.databind.MapperFeature. When specifying multiple features, separate them with a comma. Requires the Jackson library.
Enable Jaxb Annotation Module Enables the JAXB annotation module, allowing Jackson to use JAXB annotations. Requires the Jackson library.
Include Specifies the fields to exclude from the Json output when marshalling a POJO to Json, when using Gson or Xstream.
Json View Specifies the fields to exclude from the Json output when marshalling a POJO to Json when using Jackson. Requires the Jackson library. First you create one or more marker classes, then annotate the marker classes with the @JasonView annotation to exclude specific fields, and then use CamelJacksonDataFormatto marshal the POJO to Json. For details, see Json.
Library Specifies the library to use for marshalling. Select either XStream, Jackson, or Gson from the drop-down list. Default is XStream.
Module Class Names Specifies the name or names of custom Jackson modules to use from com.fasterxml.jackson.databind.Module. Names are specified as a string of FNQ classnames. When specifying multiple modules, separate them with a comma.
Module Refs Specifies a reference to the name or names of custom Jackson modules to use from the Camel registry. Names are specified as a string of FNQ classnames. When referencing multiple modules, separate them with a comma.
Pretty Print Enables pretty printing, which adds white space as needed to tidy up the resulting XML for easy reading.
Unmarshal Type Name Not Applicable.
Use List Not applicable. Specifies to use list for unmarshalling Json to a list of map POJO. Requires the Jackson library.

pgp

Table 65 describes the properties needed to configure the pgp marshaller.

Table 65. pgp Properties

NameDescription
Algorithm

Specifies the symmetric key encryption algorithm to use for encryption. Valid values are defined in org.bouncycastle.bcpg.SymmetricKeyAlgorithmTags. The default is 3 (SymmetricKeyAlgorithmTags.CAST5).

Some example values are:

  • 2 (TRIPLE DES)

  • 4 (BLOWFISH)

  • 6 (DES)

  • 7 (AES_128)

ArmoredSpecifies whether to base64 encode the encrypted text, so it can be copied/pasted, and so on. The default is Disabled.
Compression Algorithm

Specifies the compression algorithm to use for encryption. Valid values are defined in org.bouncycastle.bcpg.CompressionAlgorithmTags. The default is 1 (CompressionAlgorithmTags.ZIP).

Some example values are:

  • 0 (UNCOMPRESSED)

  • 2 (ZLIB)

  • 3 (BZIP2)

Hash Algorithm

Specifies the hash algorithm to use for signing during encryption. Valid values are defined in org.bouncycastle.bcpg.HashAlgorithmTags. The default is 2 (HashAlgorithmTags.SHA10).

Some example values are:

  • 8 (SHA256)

  • 9 (SHA384)

  • 10 (SHA512)

  • 11 (SHA224)

Integrity Specifies whether to add an integrity check sign to the encrypted file. The default is Enabled.
Key File NameSpecifies the name of the keyring file that contains the public keys to use to encrypt the data. This file must be accessible as a classpath resource, but you can specify its location in the file system using the file: prefix; for example, org/apache/camel/component/crypto/pubring.gpg.
Key Userid

Specifies the user id of the key in the PGP keyring used during encryption.

You can also specify a portion of a user ID. For example, for user ID "TEST USER <test@camel.com>", you can specify the "Test User" part or the "test@camel.com" part.

PasswordSpecifies the password to use for opening the private key. This password is not used for encryption.
ProviderSpecifies the Java Cryptography Extension (JCE) provider to use. The default is BC (Bouncy Castle).
Signature Key File Name

Specifies an optional name of the keyring file to use for signing during encryption or for signature verification during decryption. This file must be accessible as a classpath resource, but you can specify its location in the file system using the file: prefix.

Do not set this option when Signature Key Ring is set.

Signature Key Ring

Specifies the keyring to use for signing during encryption or during signature verification.

Do not set this option when Signature Key File Name is set.

Signature Key Userid

Specifies an optional user ID for the key in the PGP keyring used for signing during encryption or for signature verification during decryption.

During the signature verification process, the specified Signature Key Userid prevents public keys in the public keyring being used for verification. If not specified, any public key in the public keyring can be used for verification.

You can also specify a portion of the user ID. For example, for user ID "TEST USER <test@camel.com>", you can specify the "Test User" part or the "test@camel.com" part.

Signature PasswordSpecifies an optional password to use when opening the private key used for signing during encryption.
Signature Verification Option

Not applicable. Controls the behavior of signature verification during decryption.

Valid values are:

  • optional—The PGP message may or may not contain signatures. If it contains signatures, signature verification is executed.

  • required—The PGP message must contain at least one signature. If so, signature verification is executed. If not, a PGPException is thrown.

  • ignore—Signatures contained in the PGP message are ignored, and no signature verification is performed.

  • no_signature_allowed—The PGP message must not contain a signature. If it does, a PGPException is thrown.

The default is optional.


protobuf

Table 66 describes the properties needed to configure the protobuf marshaller.

Table 66. protobuf Properties

NameDescription
Instance Class Specifies the name of the instance class to use for marshalling. This is one of the classes generated when you compiled your .proto file. Include the builder generated in the uri; for example, org.apache.camel.dataformat.protobuf.generated.<nameOfInstanceClass>.

secureXML

Table 67 describes the properties needed to configure the secureXML marshaller.

Table 67. secureXML Properties

NameDescription
Add Key Value For Encrypted Key [a]Enables/Disables adding the public key used to encrypt the session key as a key value in the EncryptedKey structure, when performing asymmetric key encryption. The default is Enabled.
Digest Algorithm [a]

Species the digest algorithm to use with the RSA OAEP algorithm. Default is XMLCipher.SHA1. Valid values are:

  • XMLCipher.SHA1

  • XMLCipher.SHA256

  • XMLCipher.SHA512

Key Cipher Algorithm [a]

Specifies the cipher algorithm to use to encrypt the asymmetric key. The default is XMLCipher.RSA_OAEP [Camel 2.12]. Valid values are:

  • XMLCipher.RSA_v1dot5NOTE: Use of this algorithm is discouraged due to attacks

  • XMLCipher.RSA_OAEP

  • XMLCipher.RSA_OAEP_11

Asymmetric key encryption is enabled when either this property or the Recipient Key Alias property is set.

Key Or Trust Store Parameters Id [a] Specifies the ID of the configuration options to use to create and load a keyStore instance that represents the sender's trustStore, when performing asymmetric key encryption.
Key Password [a] Specifies the password to use for retrieving the private key from the keystore, when performing asymmetric decryption.
Mgf Algorithm [a]

Specifies the MFG algorithm to use with the RSA OAEP algorithm, when performing asymmetric key encryption. The default is EncryptionConstants.MFG1_SHA1. Valid values are:

  • EncryptionConstants.MFG1_SHA1

  • EncryptionConstants.MFG1_SHA256

  • EncryptionConstants.MFG1_SHA512

Pass Phrase Specifies a string of alphanumeric characters to use as the passphrase for marshalling the message into cyphertext. The passphrase must be appropriate for the selected encryption algorithm. If not, the marshaller throws an exception. When no phrase is specified, the marshaller generates and uses a default passphrase.
Recipient Key Alias [a] Specifies the key alias to use for retrieving the recipient's public or private key from a keyStore when performing asymmetric key encryption.
Secure Tag Specifies the XPath reference to the XML element to encrypt. If left blank, the entire XML message is encrypted.
Secure Tag ContentsEnables/disables encryption of the contents of the XML element. The default is Disabled, which encrypts the XML element.
XML Cipher Algorithm

Specifies the cipher algorithm to use for encrypting message content. Valid values a:re:

  • XMLCipher.TRIPLIDES [Default]

  • XMLCipher.AES_128

  • XMLCipher.AES_128_GCM

  • XMLCipher.AES_192

  • XMLCipher.AES_192_GCM

  • XMLCipher.AES_256

  • XMLCipher.AES_256_GCM

  • XMLCipher.SEED_128

  • XMLCipher.CAMELLIA_128

  • XMLCipher.CAMELLIA_192

  • XMLCipher.CAMELLIA_256

[a] Used for asymmetric key encryption


soapjaxb

Table 68 describes the properties needed to configure the soapjaxb marshaller.

Table 68. soapjaxb Properties

NameDescription
Context Path Specifies the path of the package to use for initializing the JAXB context.
Element Name Strategy Ref Specifies the bean reference to use to the element name and its namespace within the body of the soap message. Select for the list of available options.
Encoding

Specifies the encoding to use when marshalling data. Valid values include:

  • ISO-8859-1

  • US-ASCII

  • UTF-8

With no value specified, Red Hat JBoss Fuse Tooling for Eclipse defaults to the encoding used by JAXB.

Namespace Prefix Ref

Specifies a reference to a map containing the namespace mapping to use when marshalling using JAXB or SOAP. This option enables you to override the default behavior of the JAXB implementation, which automatically assigns its own prefixes to namespaces.

First you define the map with mappings made up of key/value pair entries, each of which specifies a namespace (key) and prefix (value) to use for it, and assign the map an id to use as the Namespace Prefix Ref.

NOTE: This option requires that JAXB-RI 2.1 or higher (from SUN) be on the classpath.

SchemaSpecifies an existing schema to use for XML validation. You can use the prefix classpath:, file:*, or *http: to specify how to resolve the resource. Separate multiple schema files using commas (,).
Version Specifies the version of soap to use. Options are 1.1 or 1.2; the default is 1.1.

string

Table 69 describes the properties needed to configure the string marshaller.

Table 69. string Properties

NameDescription
Charset

Specifies the character set to use for encoding. Valid values include:

  • ISO-8859-1

  • US-ASCII

  • UTF-8

With no value specified, Red Hat JBoss Fuse Tooling for Eclipse defaults to the encoding used by the platform.


uniVocity-csv

Table 70 describes the properties needed to configure the uniVocity-csv marshaller.

Table 70. uniVocity-csv Properties

NameDescription
As Map

Enables/disables the production of maps, instead of lists, for line values. The default is Disabled, which causes the unmarshaller to produce lists instead of maps.

When enabling this option to produce maps instead of lists, headers must be enabled and either defined or collected.

CommentSpecifies the character to use to identify a comment. The default is #.
DelimiterSpecifies the character to use to delimit values. The default is ,.
Empty ValueSpecifies the string representation of an empty value. The default is " ".
Header Extraction EnabledEnables/disables reading in the first line of the test document as the header line. The default is Disabled.
Headers DisabledEnables/disables headers. The default is Disabled. When enabled, this option sets the headers as null, which indicates there is no header.
IdSpecifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
Ignore Leading WhitespacesEnables/disables ignoring leading white spaces in a line. The default is Enabled.
Ignore Trailing WhitespacesEnables/disables ignoring trailing white spaces in a line. The default is Enabled.
Lazy LoadNot applicable. Enables/disables unmarshaller reading lines on-the-fly. The default is Disabled, which instructs the unmarshaller to read all lines in batch.
Line SeparatorSpecifies the character to use to separate lines in a file. The default is the platform's line separator.
Normalized Line SeparatorSpecifies the character to use as the normalized line separator for files. The default is \n.
Null ValueSpecifies the string representation of a null value. The default is null.
Number Of Records To ReadSpecifies the maximum number of records to read. The default is -1 (no records).
QuoteSpecifies the character to use to mark the beginning of a quoted value. The default is ".
Quote All FieldsSpecifies whether to enclose all values in quotes when writing them. The default is Disabled.
Quote EscapeSpecifies the character to use to mark the end of a quoted value. The default is ".
Skip Empty LinesEnables/disables ignoring empty lines. The default is Enabled.

uniVocity-fixed

Table 71 describes the properties needed to configure the uniVocity-fixed marshaller.

Table 71. uniVocity-fixed Properties

NameDescription
As Map

Enables/disables the production of maps, instead of lists, for line values. The default is Disabled, which causes the unmarshaller to produce lists instead of maps.

When enabling this option to produce maps instead of lists, headers must be enabled and either defined or collected.

CommentSpecifies the character to use to identify a comment. The default is #.
Empty ValueSpecifies the string representation of an empty value. The default is " ".
Header Extraction EnabledEnables/disables reading in the first line of the test document as the header line. The default is Disabled.
Headers DisabledEnables/disables headers. The default is Disabled. When enabled, this option sets the headers as null, which indicates there is no header.
IdSpecifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
Ignore Leading WhitespacesEnables/disables ignoring leading white spaces in a line. The default is Enabled.
Ignore Trailing WhitespacesEnables/disables ignoring trailing white spaces in a line. The default is Enabled.
Lazy LoadNot applicable. Enables/disables unmarshaller reading lines on-the-fly. The default is Disabled, which instructs the unmarshaller to read all lines in batch.
Line SeparatorSpecifies the character to use to separate lines in a file. The default is the platform's line separator.
Normalized Line SeparatorSpecifies the character to use as the normalized line separator for files. The default is \n.
Null ValueSpecifies the string representation of a null value. The default is null.
Number Of Records To ReadSpecifies the maximum number of records to read. The default is -1 (no records).
PaddingSpecifies the character to use for padding. The default is ' ' (white space).
Record Ends On NewlineSpecifies whether records end at a new line. The default is Disabled.
Skip Empty LinesEnables/disables ignoring empty lines. The default is Enabled.
Skip trailing Chars Until NewlineSpecifies whether to skip trailing spaces up to a new line. The default is Disabled.

uniVocity-tsv

Table 72 describes the properties needed to configure the uniVocity-tsv marshaller.

Table 72. uniVocity-tsv Properties

NameDescription
As Map

Enables/disables the production of maps, instead of lists, for line values. The default is Disabled, which causes the unmarshaller to produce lists instead of maps.

When enabling this option to produce maps instead of lists, headers must be enabled and either defined or collected.

CommentSpecifies the character to use to identify a comment. The default is #.
Empty ValueSpecifies the string representation of an empty value. The default is " ".
Escape CharSpecifies the character to use for escape. The default is \.
Header Extraction EnabledEnables/disables reading in the first line of the test document as the header line. The default is Disabled.
Headers DisabledEnables/disables headers. The default is Disabled. When enabled, this option sets the headers as null, which indicates there is no header.
IdSpecifies a unique identifier for the endpoint. The Id can be used to refer to the endpoint in the Camel XML file.
Ignore Leading WhitespacesEnables/disables ignoring leading white spaces in a line. The default is Enabled.
Ignore Trailing WhitespacesEnables/disables ignoring trailing white spaces in a line. The default is Enabled.
Lazy LoadNot applicable. Enables/disables unmarshaller reading lines on-the-fly. The default is Disabled, which instructs the unmarshaller to read all lines in batch.
Line SeparatorSpecifies the character to use to separate lines in a file. The default is the platform's line separator.
Normalized Line SeparatorSpecifies the character to use as the normalized line separator for files. The default is \n.
Null ValueSpecifies the string representation of a null value. The default is null.
Number Of Records To ReadSpecifies the maximum number of records to read. The default is -1 (no records).
Skip Empty LinesEnables/disables ignoring empty lines. The default is Enabled.

XmlBeans

Table 73 describes the properties needed to configure the XmlBeans marshaller.

Table 73. XmlBeans Properties

NameDescription
Pretty Print Enables pretty printing, which adds white space as needed to tidy up the resulting XML for easy reading.

Xmljson

Table 74 describes the properties needed to configure the xmljson marshaller.

[Note]Note

An asterisk (*) to the right of a property name (marshaller properties only) indicates that the default value for that property is set by json-lib, not by the code of the data format.

Table 74. xmljson Properties

NameDescription
Array Name

Applies to unmarshalling only.

Element Name

Applies to unmarshalling only.

Encoding

Applies to unmarshalling only.

For marshalling, encoding is determined by the input String being processed. When converting an input Stream, json-lib uses the platform's default encoding.

Expandable Properties Applies to unmarshalling only.
Force Top Level Object *

Specifies whether the resulting json conversion starts off with a top-most element whose name matches the XML root element.

When disabled (default), the xml string <a><x>1</x><y>2</y><a> is converted to {'x:'1','y':'2'}; otherwise it's converted to {'a':'x:'1','y':'2'}}.

Namespace Lenient Applies to unmarshalling only.
Remove Namespace Prefixes *

Specifies whether to remove the namespace prefixes from XML-qualified elements so that the resulting json string does not contain them.

The default is false.

Root Name

Applies to unmarshalling only.

Skip Namespaces *

Specifies whether namespaces are ignored. When disabled (default), they are added to the json output using @xmlns elements.

Skip Whitespace * Specifies whether white spaces between XML elements are treated as text values or are ignored. When disabled (default), they are treated as text values.
Trim Spaces * Specifies whether leading and trailing white spaces are omitted in string values. When disabled (default), they are left untouched.
Type Hints Applies to unmarshalling only.

Xmlrpc

Table 75 describes the properties needed to configure the Xmlrpc marshaller.

Table 75. Xmlrpc Properties

NameDescription
Request When enabled, specifies the message is a request. When disabled, specifies the message is a response. The default is Disabled.

zip

Table 76 describes the properties needed to configure the zip marshaller.

Table 76. zip Properties

NameDescription
Compression Level

Specifies the level of compression for the marshaller to use. When no value is specified, the marshaller uses its default compression algorithm. Valid values are:

  • deflater.BEST_SPEED

    Conservative compression, optimized for speed.

  • deflater.BEST_COMPRESSION

    Aggressive compression, slowest speed.

  • deflater.DEFAULT_COMPRESSION

    Moderate compression, moderate speed.


zipFile

Table 77 describes the properties needed to configure the zipFile marshaller.

Table 77. zipFile Properties

NameDescription
Using Iterator

Applies only to Unmarshalling. The default is Disabled.


Related topics

Adding beans and configuration