Interface Paragraph
- All Known Implementing Classes:
PowerpointParagraph, StandardParagraph
public interface Paragraph
The Paragraph interface represents a paragraph in a text document.
It provides methods for replacing a placeholder within the paragraph and retrieving the paragraph as a string.
-
Method Summary
Modifier and TypeMethodDescriptionvoidApplies the specified consumer function to the paragraph content.asString()Returns the paragraph as a string.Collection<org.docx4j.wml.Comments.Comment> Retrieves a collection of comments associated with the paragraph.<T> Optional<T> Retrieves the parent of the current paragraph that matches the specified class type.Retrieves the parent table of the current paragraph, if it exists.Retrieves the parent table row of the current paragraph, if it exists.voidremove()Removes the paragraph from the document.voidReplaces a section of elements within the document, defined by the start and end objects, with the elements provided by the given insert.voidReplaces a specified placeholder within the paragraph with the provided insert.voidReplaces specified contiguous elements within the paragraph with new elements.
-
Method Details
-
replace
-
remove
void remove()Removes the paragraph from the document. This method is intended to be used when a paragraph needs to be deleted. -
replace
-
replace
Replaces a section of elements within the document, defined by the start and end objects, with the elements provided by the given insert.- Parameters:
start- the starting object marking the beginning of the section to replace.end- the ending object marking the end of the section to replace.insert- the insert containing the elements that will replace the specified section.
-
asString
-
apply
Applies the specified consumer function to the paragraph content.- Parameters:
pConsumer- The consumer function to apply to the paragraph content.
-
parent
Retrieves the parent of the current paragraph that matches the specified class type. -
getComment
Collection<org.docx4j.wml.Comments.Comment> getComment()Retrieves a collection of comments associated with the paragraph.- Returns:
- a collection of
Comments.Commentobjects related to the paragraph
-
parentTableRow
-
parentTable
-