Class MarkdownDocParser
- All Implemented Interfaces:
MarkdownMetaProvider,RecordReadable
Media types
Handles
Description
Extends MarkdownParser to parse Markdown documents produced by MarkdownDocSerializer.
Heading sections are mapped back to nested bean properties based on heading text matching property names.
Example:
Limitations:
- Heading text must match bean property names exactly (case-sensitive).
- Heading levels must be consistent with serializer output; manually edited heading levels may not parse correctly.
- A heading followed by a bulleted list is treated as a
List<String>property. - A heading followed by a multi-column table is treated as a
List<Bean>property. - The top-level heading (title) is ignored; only sub-headings map to properties.
- This class is thread safe and reusable.
See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.apache.juneau.marshall.markdown.MarkdownParser
MarkdownParser.DefaultBuilderNested classes/interfaces inherited from class org.apache.juneau.marshall.parser.Parser
Parser.Null -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MarkdownDocParserDefault parser, all default settings.Fields inherited from class org.apache.juneau.marshall.parser.Parser
autoCloseStreams, consumes, debugOutputLines, listener, nulls, trimStrings, unbufferedFields inherited from class org.apache.juneau.marshall.MarshallingContextable
marshallingContextFields inherited from class org.apache.juneau.marshall.Context
CONTEXT_APPLY_FILTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()Creates a builder from this context object.static MarkdownDocParser.Buildercreate()Creates a new builder for this object.Create a session builder based on the properties defined on this context.Returns a session to use for this context.Methods inherited from class org.apache.juneau.marshall.markdown.MarkdownParser
getMarkdownBeanPropertyMeta, getMarkdownClassMeta, getNullValue, isRecordStreaming, readRecordsMethods inherited from class org.apache.juneau.marshall.parser.ReaderParser
getStreamCharset, isReaderParser, propertiesMethods inherited from class org.apache.juneau.marshall.parser.Parser
canHandle, createParserBuilder, doRead, getDebugOutputLines, getListener, getMediaTypes, getNulls, getPrimaryMediaType, isAutoCloseStreams, isTrimStrings, isUnbuffered, read, read, read, read, read, read, readArgs, readIntoCollection, readIntoMap, readWithOuterMethods inherited from class org.apache.juneau.marshall.MarshallingContextable
getDurationFormat, getMarshallingContext, getPeriodFormatMethods inherited from class org.apache.juneau.marshall.Context
createBuilder, getAnnotationProvider, init, isDebug, toString
-
Field Details
-
DEFAULT
Default parser, all default settings.
-
-
Constructor Details
-
MarkdownDocParser
Constructor.- Parameters:
builder- The builder for this object.
-
-
Method Details
-
create
Creates a new builder for this object.- Returns:
- A new builder.
-
copy
Description copied from class:ContextCreates a builder from this context object.Builders are used to define new contexts (e.g. serializers, parsers) based on existing configurations.
- Overrides:
copyin classMarkdownParser- Returns:
- A new Builder object.
-
createSession
Description copied from class:ContextCreate a session builder based on the properties defined on this context.Use this method for creating sessions where you want to override basic settings. Otherwise, use
Context.getSession()directly.- Overrides:
createSessionin classMarkdownParser- Returns:
- A new session builder.
-
getSession
Description copied from class:ContextReturns a session to use for this context.Note that subclasses may opt to return a reusable non-modifiable session.
- Overrides:
getSessionin classMarkdownParser- Returns:
- A new session object.
-