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 aCharSequence
and returns a newCharSequence
with the modified text.default StringBuilder
toStringBuilder(CharSequence text)
Returns aStringBuilder
for the givenCharSequence
.
-
Method Details
-
apply
Applies the filter on aCharSequence
and returns a newCharSequence
with the modified text.- Specified by:
apply
in interfaceFunction<CharSequence,CharSequence>
- Parameters:
t
-CharSequence
with the contents to be filtered. If this is aStringBuilder
instance, its contents may have changed after invocation, and this instance should not be used any more.- Returns:
CharSequence
with the filtered text.
-
toStringBuilder
Returns aStringBuilder
for the givenCharSequence
. If theCharSequence
is aStringBuilder
instance, it will be reused.- Parameters:
text
-CharSequence
to get aStringBuilder
from- Returns:
StringBuilder
instance
-