Class SpecialLeadInStartsWithCharsHandler
- java.lang.Object
-
- com.vladsch.flexmark.util.sequence.mappers.SpecialLeadInStartsWithCharsHandler
-
- All Implemented Interfaces:
SpecialLeadInHandler
public class SpecialLeadInStartsWithCharsHandler extends java.lang.Object implements SpecialLeadInHandler
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SpecialLeadInStartsWithCharsHandler(CharPredicate predicate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SpecialLeadInStartsWithCharsHandler
create(char leadInChar)
static SpecialLeadInStartsWithCharsHandler
create(java.lang.CharSequence leadInChar)
boolean
escape(BasedSequence sequence, DataHolder options, java.util.function.Consumer<java.lang.CharSequence> consumer)
Escape special lead-in characters which start a block element if first non-whitespace on the lineboolean
unEscape(BasedSequence sequence, DataHolder options, java.util.function.Consumer<java.lang.CharSequence> consumer)
UnEscape special lead-in characters which start a block element if first non-whitespace on the line
-
-
-
Constructor Detail
-
SpecialLeadInStartsWithCharsHandler
protected SpecialLeadInStartsWithCharsHandler(CharPredicate predicate)
-
-
Method Detail
-
escape
public boolean escape(@NotNull BasedSequence sequence, @Nullable DataHolder options, @NotNull java.util.function.Consumer<java.lang.CharSequence> consumer)
Escape special lead-in characters which start a block element if first non-whitespace on the lineThe leadIn sequence is always followed by a space or EOL so if lead in does not require a space to start a block element then test if it starts with the special sequence, otherwise test if it equals the special sequence
- Specified by:
escape
in interfaceSpecialLeadInHandler
- Parameters:
sequence
- char sequence appearing as first non-whitespace on a lineoptions
- optionsconsumer
- consumer of char sequences to be called for the leadIn if it is changed by this handler- Returns:
- true if sequence was a lead in for the handler
-
unEscape
public boolean unEscape(@NotNull BasedSequence sequence, @Nullable DataHolder options, @NotNull java.util.function.Consumer<java.lang.CharSequence> consumer)
UnEscape special lead-in characters which start a block element if first non-whitespace on the lineThe leadIn sequence is always followed by a space or EOL so if lead in does not require a space to start a block element then test if it starts with the special sequence, otherwise test if it equals the special sequence
- Specified by:
unEscape
in interfaceSpecialLeadInHandler
- Parameters:
sequence
- char sequence appearing as first non-whitespace on a lineoptions
- optionsconsumer
- consumer of char sequences to be called for the leadIn if it is changed by this handler- Returns:
- true if sequence was a lead in for the handler
-
create
@NotNull public static SpecialLeadInStartsWithCharsHandler create(char leadInChar)
-
create
@NotNull public static SpecialLeadInStartsWithCharsHandler create(@NotNull java.lang.CharSequence leadInChar)
-
-