Top Fields Constructors Methods
com.vladsch.flexmark.util.sequence.mappers

public Class SpecialLeadInCharsHandler

extends Object
implements SpecialLeadInHandler
Class Inheritance
All Implemented Interfaces
com.vladsch.flexmark.util.sequence.mappers.SpecialLeadInHandler
Imports
com.vladsch.flexmark.util.data.DataHolder, com.vladsch.flexmark.util.misc.CharPredicate, com.vladsch.flexmark.util.sequence.BasedSequence, org.jetbrains.annotations.NotNull, .Nullable, java.util.function.Consumer

Field Summary

Modifier and TypeField and Description
pack-priv final CharPredicate

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static @NotNull SpecialLeadInCharsHandler
create(char leadInChar)

public static @NotNull SpecialLeadInCharsHandler
public boolean

Returns:

true if sequence was a lead in for the handler
escape
(@NotNull BasedSequence
char sequence appearing as first non-whitespace on a line
sequence
,
@Nullable DataHolder
options
options
,
@NotNull Consumer<CharSequence>
consumer of char sequences to be called for the leadIn if it is changed by this handler
consumer
)

Escape special lead-in characters which start a block element if first non-whitespace on the line

The 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

public boolean

Returns:

true if sequence was a lead in for the handler
unEscape
(@NotNull BasedSequence
char sequence appearing as first non-whitespace on a line
sequence
,
@Nullable DataHolder
options
options
,
@NotNull Consumer<CharSequence>
consumer of char sequences to be called for the leadIn if it is changed by this handler
consumer
)

UnEscape special lead-in characters which start a block element if first non-whitespace on the line

The 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

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

predicateback to summary
pack-priv final CharPredicate predicate

Constructor Detail

SpecialLeadInCharsHandlerback to summary
protected SpecialLeadInCharsHandler(CharPredicate predicate)

Method Detail

createback to summary
public static @NotNull SpecialLeadInCharsHandler create(char leadInChar)
Annotations
@NotNull
createback to summary
public static @NotNull SpecialLeadInCharsHandler create(@NotNull CharSequence leadInChar)
Annotations
@NotNull
escapeback to summary
public boolean escape(@NotNull BasedSequence sequence, @Nullable DataHolder options, @NotNull Consumer<CharSequence> consumer)

Escape special lead-in characters which start a block element if first non-whitespace on the line

The 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

Parameters
sequence:@NotNull BasedSequence

char sequence appearing as first non-whitespace on a line

options:@Nullable DataHolder

options

consumer:@NotNull Consumer<CharSequence>

consumer of char sequences to be called for the leadIn if it is changed by this handler

Returns:boolean

true if sequence was a lead in for the handler

Annotations
@Override
unEscapeback to summary
public boolean unEscape(@NotNull BasedSequence sequence, @Nullable DataHolder options, @NotNull Consumer<CharSequence> consumer)

UnEscape special lead-in characters which start a block element if first non-whitespace on the line

The 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

Parameters
sequence:@NotNull BasedSequence

char sequence appearing as first non-whitespace on a line

options:@Nullable DataHolder

options

consumer:@NotNull Consumer<CharSequence>

consumer of char sequences to be called for the leadIn if it is changed by this handler

Returns:boolean

true if sequence was a lead in for the handler

Annotations
@Override