类 WDocument

java.lang.Object
org.anyline.office.docx.entity.WDocument

public class WDocument extends Object
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    boolean
     
  • 构造器概要

    构造器
    构造器
    说明
     
     
  • 方法概要

    修饰符和类型
    方法
    说明
    org.dom4j.Element
    after(org.dom4j.Element element, String html)
    在element之后 插入节点 解析html有可能解析出多个element这里会返回最外层的最后一个
    org.dom4j.Element
    after(org.dom4j.Element point, Wtable table)
     
    org.dom4j.Element
    after(org.dom4j.Element point, org.dom4j.Element element)
     
    org.dom4j.Element
    before(org.dom4j.Element element, String html)
    在element之前插入节点
    org.dom4j.Element
    before(org.dom4j.Element point, Wtable table)
     
    org.dom4j.Element
    before(org.dom4j.Element point, org.dom4j.Element element)
     
    org.dom4j.Element
    block(org.dom4j.Element parent, org.dom4j.Element prev, org.dom4j.Element element, Map<String,String> styles)
     
    void
     
    org.dom4j.Element
     
    static int
    index(org.dom4j.Element parent, org.dom4j.Element element)
     
    org.dom4j.Element
    insert(int index, org.dom4j.Element parent, String html)
     
    org.dom4j.Element
    insert(int index, org.dom4j.Element parent, Wtable table)
     
    org.dom4j.Element
    insert(int index, org.dom4j.Element parent, org.dom4j.Element element)
     
    org.dom4j.Element
    insert(org.dom4j.Element prev, File file)
     
    org.dom4j.Element
    insert(org.dom4j.Element parent, String html)
     
    org.dom4j.Element
    insert(org.dom4j.Element parent, Wtable table)
     
    org.dom4j.Element
    insert(org.dom4j.Element parent, org.dom4j.Element element)
     
    void
    insertPageBreak(org.dom4j.Element prev)
     
     
     
    void
     
    org.dom4j.Element
    p(org.dom4j.Element element)
     
    org.dom4j.Element
    p(org.dom4j.Element parent, String text, Map<String,String> styles)
     
    org.dom4j.Element
    parent(String bookmark)
     
    org.dom4j.Element
    parent(String bookmark, String tag)
    获取书签所在的标签 通常用来定位
    org.dom4j.Element
    parent(org.dom4j.Element element, String... tags)
     
    org.dom4j.Element
    parseHtml(org.dom4j.Element parent, org.dom4j.Element prev, org.dom4j.Element html, Map<String,String> styles)
     
    org.dom4j.Element
    parseHtml(org.dom4j.Element parent, org.dom4j.Element prev, org.dom4j.Element html, Map<String,String> styles, boolean copyPrevStyle)
    解析html
    org.dom4j.Element
    pp(org.dom4j.Element element)
    找到到当前p的上一级(用来创建与当前所在p平级的新p,遇到tc停止)
    org.dom4j.Element
    pr(org.dom4j.Element element, Map<String,String> styles)
     
    org.dom4j.Element
    prevStyle(org.dom4j.Element prev)
     
    org.dom4j.Element
    r(org.dom4j.Element parent, String text, Map<String,String> styles)
     
    void
     
    remove(Wtable table)
     
    remove(org.dom4j.Element element)
     
    void
    replace(String key, String content)
     
    void
     
    void
    save(Charset charset)
     
    void
    setBody(org.dom4j.Element body)
     
    void
    setOrient(org.dom4j.Element prev, String orient)
     
    void
    setOrient(org.dom4j.Element prev, String orient, Map<String,String> styles)
     
    style(org.dom4j.Element element)
     
    table(String bookmark)
     
    org.dom4j.Element
    table(org.dom4j.Element box, org.dom4j.Element after, org.dom4j.Element src)
     
     
    tables(boolean recursion)
    获取doby下的table
    org.dom4j.Element
    tc(org.dom4j.Element parent, org.anyline.entity.html.Td td)
     
    org.dom4j.Element
    tr(org.dom4j.Element parent, org.anyline.entity.html.Tr tr)
     

    从类继承的方法 java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 字段详细资料

    • IS_HTML_ESCAPE

      public boolean IS_HTML_ESCAPE
  • 构造器详细资料

    • WDocument

      public WDocument(File file)
    • WDocument

      public WDocument(String file)
  • 方法详细资料

    • getBody

      public org.dom4j.Element getBody()
    • setBody

      public void setBody(org.dom4j.Element body)
    • reload

      public void reload()
    • flush

      public void flush()
    • loadStyle

      public void loadStyle(String html)
    • replace

      public void replace(String key, String content)
    • before

      public org.dom4j.Element before(org.dom4j.Element element, String html)
      在element之前插入节点
      参数:
      element - element
      html - html
    • before

      public org.dom4j.Element before(org.dom4j.Element point, org.dom4j.Element element)
    • before

      public org.dom4j.Element before(org.dom4j.Element point, Wtable table)
    • after

      public org.dom4j.Element after(org.dom4j.Element point, org.dom4j.Element element)
    • after

      public org.dom4j.Element after(org.dom4j.Element point, Wtable table)
    • after

      public org.dom4j.Element after(org.dom4j.Element element, String html)
      在element之后 插入节点 解析html有可能解析出多个element这里会返回最外层的最后一个
      参数:
      element - element
      html - html
      返回:
      Element
    • insert

      public org.dom4j.Element insert(org.dom4j.Element parent, String html)
    • insert

      public org.dom4j.Element insert(int index, org.dom4j.Element parent, String html)
    • insert

      public org.dom4j.Element insert(org.dom4j.Element parent, org.dom4j.Element element)
    • insert

      public org.dom4j.Element insert(org.dom4j.Element parent, Wtable table)
    • insert

      public org.dom4j.Element insert(int index, org.dom4j.Element parent, org.dom4j.Element element)
    • insert

      public org.dom4j.Element insert(int index, org.dom4j.Element parent, Wtable table)
    • parent

      public org.dom4j.Element parent(String bookmark, String tag)
      获取书签所在的标签 通常用来定位
      参数:
      bookmark - 书签
      tag - 上一级标签名 如tbl
      返回:
      Element
    • parent

      public org.dom4j.Element parent(String bookmark)
    • table

      public Wtable table(String bookmark)
    • tables

      public List<Wtable> tables(boolean recursion)
      获取doby下的table
      参数:
      recursion - 是否递归获取所有级别的table,正常情况下不需要,word中的tbl一般在body下的最顶级,除非有表格嵌套
      返回:
      tables
    • tables

      public List<Wtable> tables()
    • setOrient

      public void setOrient(org.dom4j.Element prev, String orient, Map<String,String> styles)
    • setOrient

      public void setOrient(org.dom4j.Element prev, String orient)
    • insertPageBreak

      public void insertPageBreak(org.dom4j.Element prev)
    • index

      public static int index(org.dom4j.Element parent, org.dom4j.Element element)
    • pr

      public org.dom4j.Element pr(org.dom4j.Element element, Map<String,String> styles)
    • parent

      public org.dom4j.Element parent(org.dom4j.Element element, String... tags)
    • pp

      public org.dom4j.Element pp(org.dom4j.Element element)
      找到到当前p的上一级(用来创建与当前所在p平级的新p,遇到tc停止)
      参数:
      element - 当前节点
      返回:
      Element
    • p

      public org.dom4j.Element p(org.dom4j.Element element)
    • table

      public org.dom4j.Element table(org.dom4j.Element box, org.dom4j.Element after, org.dom4j.Element src)
    • tr

      public org.dom4j.Element tr(org.dom4j.Element parent, org.anyline.entity.html.Tr tr)
    • tc

      public org.dom4j.Element tc(org.dom4j.Element parent, org.anyline.entity.html.Td td)
    • prevStyle

      public org.dom4j.Element prevStyle(org.dom4j.Element prev)
    • block

      public org.dom4j.Element block(org.dom4j.Element parent, org.dom4j.Element prev, org.dom4j.Element element, Map<String,String> styles)
    • parseHtml

      public org.dom4j.Element parseHtml(org.dom4j.Element parent, org.dom4j.Element prev, org.dom4j.Element html, Map<String,String> styles, boolean copyPrevStyle)
      解析html
      参数:
      parent - 上一级
      prev - 放在prev之后
      html - html
      styles - 样式
      copyPrevStyle - 是否复制前一个标签的样式,在替换书签时需要用到,但在div中嵌套的span需要避免复制闰一个标签的样式
      返回:
      prev
    • remove

      public WDocument remove(org.dom4j.Element element)
    • remove

      public WDocument remove(Wtable table)
    • parseHtml

      public org.dom4j.Element parseHtml(org.dom4j.Element parent, org.dom4j.Element prev, org.dom4j.Element html, Map<String,String> styles)
    • p

      public org.dom4j.Element p(org.dom4j.Element parent, String text, Map<String,String> styles)
    • r

      public org.dom4j.Element r(org.dom4j.Element parent, String text, Map<String,String> styles)
    • style

      public Map<String,String> style(org.dom4j.Element element)
    • listStyle

      public String listStyle(String key)
    • insert

      public org.dom4j.Element insert(org.dom4j.Element prev, File file)
    • listStyles

      public List<String> listStyles()
    • save

      public void save()
    • save

      public void save(Charset charset)