Package dev.gmitch215.bytebox.html
Interface TextChunk
- All Superinterfaces:
org.teavm.jso.JSObject
public interface TextChunk
extends org.teavm.jso.JSObject
A piece of text. The parser does not buffer, so one text node can arrive as several chunks; the
last has
isLastInTextNode() set and may be empty.- Since:
- 1.0.3
-
Method Summary
Modifier and TypeMethodDescriptionInserts text after the chunk.after(String content, ContentOptions options) Inserts content after the chunk.Inserts text before the chunk.before(String content, ContentOptions options) Inserts content before the chunk.getText()Returns the text of this chunk.booleanReturns whether this is the last chunk of its text node.booleanReturns whether an earlier handler already removed or replaced this chunk.remove()Removes the chunk.Replaces the chunk by text.replace(String content, ContentOptions options) Replaces the chunk by other content.Methods inherited from interface org.teavm.jso.JSObject
cast
-
Method Details
-
getText
String getText()Returns the text of this chunk.- Returns:
- the text of this chunk
-
isLastInTextNode
boolean isLastInTextNode()Returns whether this is the last chunk of its text node.- Returns:
- whether this is the last chunk of its text node
-
isRemoved
boolean isRemoved()Returns whether an earlier handler already removed or replaced this chunk.- Returns:
- whether an earlier handler already removed or replaced this chunk
-
before
Inserts text before the chunk.- Parameters:
content- the text, escaped- Returns:
- this chunk
-
before
Inserts content before the chunk.- Parameters:
content- the contentoptions- how to read it- Returns:
- this chunk
-
after
Inserts text after the chunk.- Parameters:
content- the text, escaped- Returns:
- this chunk
-
after
Inserts content after the chunk.- Parameters:
content- the contentoptions- how to read it- Returns:
- this chunk
-
replace
Replaces the chunk by text.- Parameters:
content- the text, escaped- Returns:
- this chunk
-
replace
Replaces the chunk by other content.- Parameters:
content- the contentoptions- how to read it- Returns:
- this chunk
-
remove
TextChunk remove()Removes the chunk.- Returns:
- this chunk
-