Package org.shredzone.commons.text
Interface TextFilter
- All Superinterfaces:
Function<CharSequence,CharSequence>
- All Known Implementing Classes:
GithubFlavoredMarkdownFilter,HtmlEscapeFilter,KeepFilter,LinkToUrlFilter,MarkdownFilter,NofollowLinksFilter,NormalizeFilter,ParagraphFilter,SimplifyHtmlFilter,SmilyFilter,StripHtmlFilter,TextileFilter
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A text filter modifies a text in a defined manner. It should be highly optimized for
speed.
Text filters are thread safe unless stated otherwise.
Text filters are stateless unless stated otherwise.
- Author:
- Richard "Shred" Körber
-
Method Summary
Modifier and TypeMethodDescriptionapply(CharSequence t)Applies the filter on aCharSequenceand returns a newCharSequencewith the modified text.default StringBuildertoStringBuilder(CharSequence text)Returns aStringBuilderfor the givenCharSequence.
-
Method Details
-
apply
Applies the filter on aCharSequenceand returns a newCharSequencewith the modified text.- Specified by:
applyin interfaceFunction<CharSequence,CharSequence>- Parameters:
t-CharSequencewith the contents to be filtered. If this is aStringBuilderinstance, its contents may have changed after invocation, and this instance should not be used any more.- Returns:
CharSequencewith the filtered text.
-
toStringBuilder
Returns aStringBuilderfor the givenCharSequence. If theCharSequenceis aStringBuilderinstance, it will be reused.- Parameters:
text-CharSequenceto get aStringBuilderfrom- Returns:
StringBuilderinstance
-