Class EntryReader.EntryFormat

java.lang.Object
org.plumelib.util.EntryReader.EntryFormat
Enclosing class:
EntryReader

public static class EntryReader.EntryFormat extends Object
This class informs EntryReader where an entry begins and ends.
  • Field Details

    • DEFAULT

      public static final EntryReader.EntryFormat DEFAULT
      An EntryFormat using a single blank line to separate entries, with no multi-line entries and no fenced code blocks.
    • TWO_BLANK_LINES

      public static final EntryReader.EntryFormat 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

      public static final EntryReader.EntryFormat 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

      public static final EntryReader.EntryFormat 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

      public final @Nullable @Regex(1) Pattern 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 on twoBlankLines) 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

      public final Pattern entryStopRegex
      See Also:
    • twoBlankLines

      public final boolean twoBlankLines
      If true, then entries are separated by two blank lines rather than one.
    • supportsFences

      public final boolean supportsFences
      If 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; see entryStartRegex
      entryStopRegex - regular expression that ends a long entry; see entryStartRegex
      twoBlankLines - if true, then entries are separated by two blank lines rather than one
      supportsFences - 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; see entryStartRegex
      entryStopRegex - regular expression that ends a long entry; see entryStartRegex
      twoBlankLines - if true, then entries are separated by two blank lines rather than one
      supportsFences - if true, then fenced code blocks are respected