Class RunUtil


  • public class RunUtil
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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).
      static org.docx4j.wml.R create​(Object content)
      Creates a new run with the given object as content.
      static org.docx4j.wml.R create​(String text)
      Creates a new run with the specified text.
      static org.docx4j.wml.R create​(String text, org.docx4j.wml.P parentParagraph)
      Creates a new run with the specified text and inherits the style of the parent paragraph.
      static String getText​(org.docx4j.wml.R run)
      Returns the text string of a run.
      static void setText​(org.docx4j.wml.R run, String text)
      Sets the text of the given run to the given value.
    • Method Detail

      • getText

        public static String getText​(org.docx4j.wml.R run)
        Returns the text string of a run.
        Parameters:
        run - the run whose text to get.
        Returns:
        String representation of the 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

        public static void setText​(org.docx4j.wml.R run,
                                   String text)
        Sets the text of the given run to the given value.
        Parameters:
        run - the run whose text to change.
        text - the text to set.
      • create

        public static org.docx4j.wml.R create​(String text)
        Creates a new run with the specified text.
        Parameters:
        text - the initial text of the run.
        Returns:
        the newly created run.
      • create

        public static org.docx4j.wml.R create​(Object content)
        Creates a new run with the given object as content.
        Parameters:
        content - the content of the run.
        Returns:
        the newly created run.
      • create

        public static org.docx4j.wml.R create​(String text,
                                              org.docx4j.wml.P parentParagraph)
        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.