RTI Connext Java API  Version 6.1.1
PrintFormatProperty Class Reference

A collection of attributes used to configure how data samples will be formatted when converted to a string. More...

Public Attributes

PrintFormatKind kind = PrintFormatKind.DEFAULT_PRINT_FORMAT
 The kind of format to be used when converting a data sample to a string. More...
 
boolean pretty_print = true
 Choose whether to print a data sample in a more readable format or to eliminate all white space. More...
 
boolean enum_as_int = false
 Choose whether to print enum values as integers or as strings. More...
 
boolean include_root_elements = true
 Choose whether or not to include the root elements of the print format in the output string. More...
 

Detailed Description

A collection of attributes used to configure how data samples will be formatted when converted to a string.

Member Data Documentation

◆ kind

The kind of format to be used when converting a data sample to a string.

Data samples can be represented in a default, XML, or JSON format.

See also
com.rti.dds.topic.PrintFormatKind

[default] com.rti.dds.topic.PrintFormatKind.DEFAULT_PRINT_FORMAT

Referenced by DynamicData.to_string().

◆ pretty_print

boolean pretty_print = true

Choose whether to print a data sample in a more readable format or to eliminate all white space.

A value of com.rti.dds.infrastructure.true will add indentation and newlines to the string representation of the data sample making it more readable. For example:

<FooType>
<myLong>5</myLong>
</FooType>

A value of com.rti.dds.infrastructure.false will cause all white space in the string representation of the data sample to be eliminated. For example:

<FooType><myLong>5</myLong></FooType>

[default] com.rti.dds.infrastructure.true

◆ enum_as_int

boolean enum_as_int = false

Choose whether to print enum values as integers or as strings.

A value of com.rti.dds.infrastructure.true will cause enumeration literals to be printed using their integer value. For example:

<FooType>
<myEnum>5</myEnum>
</FooType>

A value of com.rti.dds.infrastructure.false will cause enumeration literals to be printed as strings using their member names. For example:

<FooType>
<myEnum>RED</myEnum>
</FooType>

[default] com.rti.dds.infrastructure.false

◆ include_root_elements

boolean include_root_elements = true

Choose whether or not to include the root elements of the print format in the output string.

This field only applies if the com.rti.dds.topic.PrintFormatProperty.kind is com.rti.dds.topic.PrintFormatKind.XML_PRINT_FORMAT or com.rti.dds.topic.PrintFormatKind.JSON_PRINT_FORMAT

If the value is com.rti.dds.infrastructure.true and the kind is com.rti.dds.topic.PrintFormatKind.XML_PRINT_FORMAT then a top-level tag with the type's name in it will be included in the output. For example:

<FooType>
<myLong>5</myLong>
</FooType>

If the value is com.rti.dds.infrastructure.true and the kind is com.rti.dds.topic.PrintFormatKind.JSON_PRINT_FORMAT then top-level opening and closing braces will be included in the output. For example:

{
"myLong":5
}

If the value is com.rti.dds.infrastructure.false the elements described above will not be included in the output. For example:

<myLong>5</myLong>
"myLong":5

[default] com.rti.dds.infrastructure.true