- All Known Implementing Classes:
PowerpointParagraph
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 TypeMethodDescriptionasString()
Returns the paragraph as a string.default boolean
Deprecated, for removal: This API element is subject to removal in a future version.was used by the core to deal with multiline paragraphsvoid
replace
(Placeholder placeholder, Object replacement) Replaces a placeholder in the given paragraph with the specified replacement.default void
replaceAll
(Placeholder placeholder, org.docx4j.wml.R replacement) Deprecated, for removal: This API element is subject to removal in a future version.was used by the core to deal with multiline paragraphs, users should fallback toreplace(Placeholder, Object)
only
-
Method Details
-
replaceAll
@Deprecated(since="2.4", forRemoval=true) default void replaceAll(Placeholder placeholder, org.docx4j.wml.R replacement) Deprecated, for removal: This API element is subject to removal in a future version.was used by the core to deal with multiline paragraphs, users should fallback toreplace(Placeholder, Object)
onlyReplaces all occurrences of a placeholder with a specified replacement value within a paragraph.- Parameters:
placeholder
- The placeholder to be replaced.replacement
- The replacement value for the placeholder.
-
contains
Deprecated, for removal: This API element is subject to removal in a future version.was used by the core to deal with multiline paragraphsReturns true if the given expression is found within the paragraph, otherwise returns false.- Parameters:
expression
- The string to search for within the paragraph.- Returns:
- true if the given expression is found within the paragraph, otherwise false.
-
replace
Replaces a placeholder in the given paragraph with the specified replacement.- Parameters:
placeholder
- The placeholder to be replaced.replacement
- The replacement for the placeholder.
-
asString
String asString()Returns the paragraph as a string.- Returns:
- the paragraph as a string
-