public class NoteShortener extends Object
Constructor and Description |
---|
NoteShortener()
Creates a NoteShortener with default settings.
|
NoteShortener(int maxShownLines,
int maxCharsOnLine,
int maxCharsOnLastLine,
int indentCharsWidth)
Creates a NoteShortener with custom settings.
|
Modifier and Type | Method and Description |
---|---|
String |
processNoteContent(String content)
Returns the shortened content or null if there is no need to shorten it.
|
static String |
replaceReadMorePlaceHolder(String content,
String replacement)
Replaces the read more placeholder with a replacement (e.g.
|
public NoteShortener()
public NoteShortener(int maxShownLines, int maxCharsOnLine, int maxCharsOnLastLine, int indentCharsWidth)
maxShownLines
- the maximum number of lines to be shown. All lines beyond this line will be cut.maxCharsOnLine
- the maximum number of characters that fit on a line before a line break is
necessary.maxCharsOnLastLine
- the maximum number of characters to be allowed on the last shown line if cutting
is necessary. A line that is the maxShownLine can have maxCharsOnLine characters.indentCharsWidth
- the number of characters that are consumed by an indent (e.g. caused by an ul tag)public static String replaceReadMorePlaceHolder(String content, String replacement)
content
- the content where the placeholder should be replacedreplacement
- the replacementpublic String processNoteContent(String content) throws NoteStoringPreProcessorException
content
- the content to shortenNoteStoringPreProcessorException
- in case content processing failsCopyright © 2019 Communote team. All rights reserved.