public abstract class HWPFDocumentCore extends POIDocument
HWPFDocument
or
HWPFOldDocument
(此类包含 Word 文档的大部分核心内容,但没有一些表结构信息。您通常希望使用 HWPFDocument 或 HWPFOldDocument 之一)
Modifier and Type | Field and Description |
---|---|
protected CHPBinTable |
_cbt
Contains formatting properties for text
(包含文本的格式属性)
|
protected FileInformationBlock |
_fib
The FIB
(FIB)
|
protected FontTable |
_ft
Holds fonts for this document.
(保存此文档的字体。)
|
protected ListTables |
_lt
Hold list tables
(保留列表)
|
protected byte[] |
_mainStream
main document stream buffer
(主文档流缓冲区)
|
protected ObjectPoolImpl |
_objectPool
Holds OLE2 objects
(持有 OLE2 对象)
|
protected PAPBinTable |
_pbt
Contains formatting properties for paragraphs
(包含段落的格式属性)
|
protected StyleSheet |
_ss
Holds styles for this document.
(保存此文档的样式。)
|
protected SectionTable |
_st
Contains formatting properties for sections.
(包含节的格式属性。)
|
protected static int |
FIB_BASE_LEN
Size of the not encrypted part of the FIB
(FIB 未加密部分的大小)
|
protected static int |
RC4_REKEYING_INTERVAL
[MS-DOC] 2.2.6.2/3 Office Binary Document ...
([MS-DOC] 2.2.6.2/3 Office 二进制文件...)
|
protected static java.lang.String |
STREAM_OBJECT_POOL |
protected static java.lang.String |
STREAM_TABLE_0 |
protected static java.lang.String |
STREAM_TABLE_1 |
protected static java.lang.String |
STREAM_WORD_DOCUMENT |
Modifier | Constructor and Description |
---|---|
protected |
HWPFDocumentCore() |
|
HWPFDocumentCore(DirectoryNode directory)
This constructor loads a Word document from a specific point in a POIFSFileSystem, probably not the default.
(此构造函数从 POIFSFileSystem 中的特定点加载 Word 文档,可能不是默认值。)
|
|
HWPFDocumentCore(java.io.InputStream istream)
This constructor loads a Word document from an InputStream.
(此构造函数从 InputStream 加载 Word 文档。)
|
|
HWPFDocumentCore(POIFSFileSystem pfilesystem)
This constructor loads a Word document from a POIFSFileSystem
(此构造函数从 POIFSFileSystem 加载 Word 文档)
|
Modifier and Type | Method and Description |
---|---|
CHPBinTable |
getCharacterTable() |
protected byte[] |
getDocumentEntryBytes(java.lang.String name, int encryptionOffset, int len)
Reads OLE Stream into byte array - if an
EncryptionInfo is available, decrypt the bytes starting at encryptionOffset.
(将 OLE 流读入字节数组 - 如果 EncryptionInfo 可用,则解密从 encryptionOffset 开始的字节。)
|
java.lang.String |
getDocumentText()
Returns document text, i.e.
(返回文档文本,即)
|
EncryptionInfo |
getEncryptionInfo() |
FileInformationBlock |
getFileInformationBlock() |
FontTable |
getFontTable() |
ListTables |
getListTables() |
byte[] |
getMainStream() |
ObjectsPool |
getObjectsPool() |
abstract Range |
getOverallRange()
Returns the range that covers all text in the file, including main text, footnotes, headers and comments
(返回覆盖文件中所有文本的范围,包括正文、脚注、标题和注释)
|
PAPBinTable |
getParagraphTable() |
abstract Range |
getRange()
Returns the range which covers the whole of the document, but excludes any headers and footers.
(返回覆盖整个文档的范围,但不包括任何页眉和页脚。)
|
SectionTable |
getSectionTable() |
StyleSheet |
getStyleSheet() |
abstract java.lang.StringBuilder |
getText()
Internal method to access document text
(访问文档文本的内部方法)
|
abstract TextPieceTable |
getTextTable() |
protected void |
updateEncryptionInfo() |
static POIFSFileSystem |
verifyAndBuildPOIFS(java.io.InputStream istream)
Takes an InputStream, verifies that it's not RTF or PDF, builds a POIFSFileSystem from it, and returns that.
(获取一个 InputStream,验证它不是 RTF 或 PDF,从中构建一个 POIFSFileSystem,然后返回它。)
|
clearDirectory, close, createInformationProperties, getDirectory, getDocumentSummaryInformation, getEncryptedPropertyStreamName, getPropertySet, getPropertySet, getSummaryInformation, initDirectory, readProperties, replaceDirectory, validateInPlaceWritePossible, write, write, write, writeProperties, writeProperties, writeProperties
protected static final java.lang.String STREAM_OBJECT_POOL
protected static final java.lang.String STREAM_WORD_DOCUMENT
protected static final java.lang.String STREAM_TABLE_0
protected static final java.lang.String STREAM_TABLE_1
protected static final int FIB_BASE_LEN
protected static final int RC4_REKEYING_INTERVAL
protected ObjectPoolImpl _objectPool
protected FileInformationBlock _fib
protected StyleSheet _ss
protected CHPBinTable _cbt
protected PAPBinTable _pbt
protected SectionTable _st
protected FontTable _ft
protected ListTables _lt
protected byte[] _mainStream
protected HWPFDocumentCore()
public HWPFDocumentCore(java.io.InputStream istream) throws java.io.IOException
istream
- The InputStream that contains the Word document.
(istream - 包含 Word 文档的 InputStream。)
java.io.IOException
- If there is an unexpected IOException from the passed in InputStream.
(java.io.IOException - 如果传入的 InputStream 出现意外的 IOException。)
public HWPFDocumentCore(POIFSFileSystem pfilesystem) throws java.io.IOException
pfilesystem
- The POIFSFileSystem that contains the Word document.
(pfilesystem - 包含 Word 文档的 POIFSFileSystem。)
java.io.IOException
- If there is an unexpected IOException from the passed in POIFSFileSystem.
(java.io.IOException - 如果传入的 POIFSFileSystem 出现意外的 IOException。)
public HWPFDocumentCore(DirectoryNode directory) throws java.io.IOException
directory
- The DirectoryNode that contains the Word document.
(directory - 包含 Word 文档的 DirectoryNode。)
java.io.IOException
- If there is an unexpected IOException from the passed in POIFSFileSystem.
(java.io.IOException - 如果传入的 POIFSFileSystem 出现意外的 IOException。)
public static POIFSFileSystem verifyAndBuildPOIFS(java.io.InputStream istream) throws java.io.IOException
java.io.IOException
(java.io.IOException)
public abstract Range getRange()
public abstract Range getOverallRange()
public java.lang.String getDocumentText()
@Internal public abstract java.lang.StringBuilder getText()
public CHPBinTable getCharacterTable()
public PAPBinTable getParagraphTable()
public SectionTable getSectionTable()
public StyleSheet getStyleSheet()
public ListTables getListTables()
public FontTable getFontTable()
public FileInformationBlock getFileInformationBlock()
public ObjectsPool getObjectsPool()
public abstract TextPieceTable getTextTable()
@Internal public byte[] getMainStream()
public EncryptionInfo getEncryptionInfo() throws java.io.IOException
getEncryptionInfo
in class
POIDocument
null
(如果文档已加密,则为加密信息,否则为 null)
java.io.IOException
- If retrieving the encryption information fails
(java.io.IOException - 如果检索加密信息失败)
protected void updateEncryptionInfo()
protected byte[] getDocumentEntryBytes(java.lang.String name, int encryptionOffset, int len) throws java.io.IOException
EncryptionInfo
is available, decrypt the bytes starting at encryptionOffset. If encryptionOffset = -1, then do not try to decrypt the bytes
(将 OLE 流读入字节数组 - 如果 EncryptionInfo 可用,则解密从 encryptionOffset 开始的字节。如果encryptionOffset = -1,则不要尝试解密字节)
name
- the name of the stream
(name - 流的名称)
encryptionOffset
- the offset from which to start decrypting, use
-1
for no decryption
(encryptionOffset - 开始解密的偏移量,使用 -1 表示不解密)
len
- length of the bytes to be read, use
Integer.MAX_VALUE
for all bytes
(len - 要读取的字节长度,对所有字节使用 Integer.MAX_VALUE)
java.io.IOException
- if the stream can't be found
(java.io.IOException - 如果找不到流)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.