Package org.plumelib.util
Class EntryReader.EntryFormat
java.lang.Object
org.plumelib.util.EntryReader.EntryFormat
- Enclosing class:
- EntryReader
This class informs
EntryReader where an entry begins and ends.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EntryReader.EntryFormatAn EntryFormat using a single blank line to separate entries, with no multi-line entries and no fenced code blocks.final @Nullable @Regex(1) PatternRegular expression that starts a long entry.final PatternSeeentryStartRegex.static final EntryReader.EntryFormatAn EntryFormat using one blank line to separate entries, with fenced code blocks but no multi-line entries.final booleanIf true, then fenced code blocks are respected.static final EntryReader.EntryFormatAn EntryFormat using two blank lines to separate entries, with no multi-line entries and no fenced code blocks.static final EntryReader.EntryFormatAn EntryFormat using two blank lines to separate entries, with fenced code blocks but no multi-line entries.final booleanIf true, then entries are separated by two blank lines rather than one. -
Constructor Summary
ConstructorsConstructorDescriptionEntryFormat(@Nullable @Regex(1) String entryStartRegex, @Nullable @Regex String entryStopRegex, boolean twoBlankLines, boolean supportsFences) Creates an EntryFormat.EntryFormat(@Nullable @Regex(1) Pattern entryStartRegex, @Nullable Pattern entryStopRegex, boolean twoBlankLines, boolean supportsFences) Creates an EntryFormat. -
Method Summary
-
Field Details
-
DEFAULT
An EntryFormat using a single blank line to separate entries, with no multi-line entries and no fenced code blocks. -
TWO_BLANK_LINES
An EntryFormat using two blank lines to separate entries, with no multi-line entries and no fenced code blocks. -
FENCED_CODE_BLOCKS
An EntryFormat using one blank line to separate entries, with fenced code blocks but no multi-line entries. -
TWO_BLANK_LINES_AND_FENCED_CODE_BLOCKS
An EntryFormat using two blank lines to separate entries, with fenced code blocks but no multi-line entries. -
entryStartRegex
Regular expression that starts a long entry. If null, there are no long entries, only short entries. A short entry is terminated by one or two blank lines (depending ontwoBlankLines) or the end of the current file.If the first line of an entry matches this regexp, it is a long entry. It is terminated by any of:
entryStopRegex- another line that matches
entryStartRegex(even not following a newline), or - the end of the current file.
If the regular expression has a capturing group, the first capturing group is retained in the output; otherwise, the whole match is removed.
-
entryStopRegex
SeeentryStartRegex.- See Also:
-
twoBlankLines
public final boolean twoBlankLinesIf true, then entries are separated by two blank lines rather than one. -
supportsFences
public final boolean supportsFencesIf true, then fenced code blocks are respected. The special "````" fence is not supported.
-
-
Constructor Details
-
EntryFormat
public EntryFormat(@Nullable @Regex(1) String entryStartRegex, @Nullable @Regex String entryStopRegex, boolean twoBlankLines, boolean supportsFences) Creates an EntryFormat.- Parameters:
entryStartRegex- regular expression that starts a long entry; seeentryStartRegexentryStopRegex- regular expression that ends a long entry; seeentryStartRegextwoBlankLines- if true, then entries are separated by two blank lines rather than onesupportsFences- if true, then fenced code blocks are respected
-
EntryFormat
public EntryFormat(@Nullable @Regex(1) Pattern entryStartRegex, @Nullable Pattern entryStopRegex, boolean twoBlankLines, boolean supportsFences) Creates an EntryFormat.- Parameters:
entryStartRegex- regular expression that starts a long entry; seeentryStartRegexentryStopRegex- regular expression that ends a long entry; seeentryStartRegextwoBlankLines- if true, then entries are separated by two blank lines rather than onesupportsFences- if true, then fenced code blocks are respected
-