Class PowerpointParagraph
java.lang.Object
pro.verron.officestamper.experimental.PowerpointParagraph
- All Implemented Interfaces:
Paragraph
A "Run" defines a region of text within a docx document with a common set of properties. Word processors are relatively free in splitting a paragraph of text into multiple runs, so there is no strict rule to say over how many runs a word or a string of words is spread.
This class aggregates multiple runs so they can be treated as a single text, no matter how many runs the text spans.
- Since:
- 1.0.8
- Version:
- ${version}
- Author:
- Joseph Verron, Tom Hombergs
-
Constructor Summary
ConstructorsConstructorDescriptionPowerpointParagraph
(PptxPart source, org.docx4j.dml.CTTextParagraph paragraph) Constructs a new ParagraphWrapper for the given paragraph. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the specified consumer function to the paragraph content.asString()
Returns the aggregated text over all runs.Collection
<org.docx4j.wml.Comments.Comment> Retrieves a collection of comments associated with the paragraph.org.docx4j.wml.P
getP()
Retrieves the paragraph associated with this object.<T> Optional
<T> Retrieves the parent of the current paragraph that matches the specified class type.processorContext
(Placeholder placeholder) Creates a processor context for the given placeholder within this paragraph.void
remove()
Removes the paragraph from the document.void
Replaces a slice of objects in the given paragraph with the specified replacement.void
Replaces specified contiguous elements within the paragraph with new elements.void
replace
(Placeholder placeholder, Object replacement) Replaces the given expression with the replacement object within the paragraph.toString()
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface Paragraph
contains, replaceAll
-
Constructor Details
-
PowerpointParagraph
Constructs a new ParagraphWrapper for the given paragraph.- Parameters:
source
- the source of the paragraph.paragraph
- the paragraph to wrap.
-
-
Method Details
-
processorContext
Description copied from interface:Paragraph
Creates a processor context for the given placeholder within this paragraph.- Specified by:
processorContext
in interfaceParagraph
- Parameters:
placeholder
- The placeholder to create a context for.- Returns:
- The processor context for the specified placeholder.
-
remove
-
replace
Description copied from interface:Paragraph
Replaces specified contiguous elements within the paragraph with new elements. -
getP
-
replace
Replaces the given expression with the replacement object within the paragraph. The replacement object must be a valid DOCX4J Object. -
asString
-
apply
-
getComment
Description copied from interface:Paragraph
Retrieves a collection of comments associated with the paragraph.- Specified by:
getComment
in interfaceParagraph
- Returns:
- a collection of
Comments.Comment
objects related to the paragraph
-
replace
Description copied from interface:Paragraph
Replaces a slice of objects in the given paragraph with the specified replacement. -
parent
Description copied from interface:Paragraph
Retrieves the parent of the current paragraph that matches the specified class type. -
toString
-