Class MarkdownDocSerializer

All Implemented Interfaces:
Function<Object,String>, ThrowingFunction<Object,String>, MarkdownMetaProvider, RecordWritable

Serializes POJO models to Markdown document mode (headings + tables).
Media types

Handles Accept types: text/markdown, text/x-markdown

Produces Content-Type types: text/markdown

Description

Extends MarkdownSerializer to produce full Markdown documents with heading-based structure. Simple bean properties are rendered in a key/value table under the top-level heading. Nested bean and map properties are rendered as sub-sections with their own headings.

Example:

// Serialize a bean to a Markdown document String md = MarkdownDocSerializer.DEFAULT.write(someBean); // Create a custom doc serializer with a document title MarkdownDocSerializer s = MarkdownDocSerializer.create().title("My Report").build(); String md = s.write(someBean);

Example output (nested bean):

# Person | Property | Value | |---|---| | name | Alice | | age | 30 | ## address | Property | Value | |---|---| | city | Boston | | state | MA |

Limitations:
  • Multi-line string values cannot round-trip; newlines are replaced with <br>.
  • The configured null value string (default: *null*) cannot be stored as a literal string value.
  • Document mode output requires MarkdownDocParser for parsing; heading text must match property names exactly.
  • This serializer is thread safe and reusable.
See Also: