Class RunUtil
java.lang.Object
org.wickedsource.docxstamper.util.RunUtil
Utility class to handle runs.
- Version:
- 1.6.6
- Author:
- Joseph Verron
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyParagraphStyle(org.docx4j.wml.P p, org.docx4j.wml.R run) Applies the style of the given paragraph to the given content object (if the content object is a Run).static org.docx4j.wml.RCreates a new run with the given object as content.static org.docx4j.wml.RCreates a new run with the specified text.static org.docx4j.wml.RCreates a new run with the specified text and inherits the style of the parent paragraph.static org.docx4j.wml.TextcreateText(String text) Creates a text object with the given text.static StringgetText(org.docx4j.wml.R run) Returns the text string of a run.static voidSets the text of the given run to the given value.
-
Method Details
-
getText
Returns the text string of a run.- Parameters:
run- the run whose text to get.- Returns:
- String representation of the run.
-
create
Creates a new run with the given object as content.- Parameters:
content- the content of the run.- Returns:
- the newly created run.
-
create
Creates a new run with the specified text and inherits the style of the parent paragraph.- Parameters:
text- the initial text of the run.parentParagraph- the parent paragraph whose style to inherit.- Returns:
- the newly created run.
-
create
Creates a new run with the specified text.- Parameters:
text- the initial text of the run.- Returns:
- the newly created run.
-
applyParagraphStyle
public static void applyParagraphStyle(org.docx4j.wml.P p, org.docx4j.wml.R run) Applies the style of the given paragraph to the given content object (if the content object is a Run).- Parameters:
p- the paragraph whose style to use.run- the Run to which the style should be applied.
-
setText
Sets the text of the given run to the given value.- Parameters:
run- the run whose text to change.text- the text to set.
-
createText
Creates a text object with the given text.- Parameters:
text- the text to set.- Returns:
- the newly created text object.
-