public abstract class HWPFDocumentCore extends POIDocument
HWPFDocument
or HWPFOldDocument
Modifier and Type | Field and Description |
---|---|
protected CHPBinTable |
_cbt
Contains formatting properties for text
|
protected FileInformationBlock |
_fib
The 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
|
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
|
protected static int |
RC4_REKEYING_INTERVAL
[MS-DOC] 2.2.6.2/3 Office Binary Document ...
|
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.
|
|
HWPFDocumentCore(java.io.InputStream istream)
This constructor loads a Word document from an InputStream.
|
|
HWPFDocumentCore(POIFSFileSystem pfilesystem)
This constructor loads a Word document from a POIFSFileSystem
|
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. |
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.
|
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.java.io.IOException
- If there is an unexpected IOException from the passed
in InputStream.public HWPFDocumentCore(POIFSFileSystem pfilesystem) throws java.io.IOException
pfilesystem
- The POIFSFileSystem that contains the Word document.java.io.IOException
- If there is an unexpected IOException from the passed
in POIFSFileSystem.public HWPFDocumentCore(DirectoryNode directory) throws java.io.IOException
directory
- The DirectoryNode that contains the Word document.java.io.IOException
- If there is an unexpected IOException from the passed
in POIFSFileSystem.public static POIFSFileSystem verifyAndBuildPOIFS(java.io.InputStream istream) throws 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
java.io.IOException
- If retrieving the encryption information failsprotected 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 bytesname
- the name of the streamencryptionOffset
- the offset from which to start decrypting, use -1
for no decryptionlen
- length of the bytes to be read, use Integer.MAX_VALUE
for all bytesjava.io.IOException
- if the stream can't be foundCopyright 2021 The Apache Software Foundation or its licensors, as applicable.