Package org.docx4j

Class TextUtils

java.lang.Object
org.docx4j.TextUtils

public class TextUtils extends Object
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A SAX ContentHandler that writes all #PCDATA onto a java.io.Writer From http://www.cafeconleche.org/books/xmljava/chapters/ch06s03.html
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Extract contents of descendant <w:t> elements.
    static void
    extractText(Object o, Writer w, jakarta.xml.bind.JAXBContext jc)
    Extract contents of descendant <w:t> elements.
    static void
    extractText(Object o, Writer w, jakarta.xml.bind.JAXBContext jc, String uri, String local, Class declaredType)
    Extract contents of descendant <w:t> elements.
    static String
    Extract contents of descendant <w:t> elements.
    static void
    main(String[] args)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • log

      private static org.slf4j.Logger log
  • Constructor Details

    • TextUtils

      public TextUtils()
  • Method Details

    • getText

      public static String getText(Object o)
      Extract contents of descendant <w:t> elements.
      Parameters:
      o -
      Returns:
      String
      Since:
      6.0.0
    • extractText

      public static void extractText(Object o, Writer w) throws Docx4JException
      Extract contents of descendant <w:t> elements.
      Parameters:
      o -
      jcSVG - JAXBContext
      Throws:
      Docx4JException
    • extractText

      public static void extractText(Object o, Writer w, jakarta.xml.bind.JAXBContext jc) throws Docx4JException
      Extract contents of descendant <w:t> elements.
      Parameters:
      o -
      jc - JAXBContext
      Throws:
      Docx4JException
    • extractText

      public static void extractText(Object o, Writer w, jakarta.xml.bind.JAXBContext jc, String uri, String local, Class declaredType) throws Docx4JException
      Extract contents of descendant <w:t> elements. Use this for objects which don't have @XmlRootElement
      Parameters:
      o -
      w -
      jc -
      uri -
      local -
      declaredType -
      Throws:
      Exception
      Docx4JException
    • main

      public static void main(String[] args) throws Exception
      Throws:
      Exception