public abstract class AbstractFormatReaderProcessor extends Object implements FormatReaderProcessor
Constructor and Description |
---|
AbstractFormatReaderProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
attachPageSegment(PageSegment pageSegment,
int streamIndex,
int pageIndex,
DocumentLayer layer)
Attach a
PageSegment to a page that has been loaded earlier within the same read
operation. |
void |
expectedPageCountDetermined(int totalExpectedPageCount)
Gives a
FormatReader the opportunity to state in advance how many pages it is going to
read. |
void |
processDocumentMetadata(Metadata metadata)
Receive document meta-data to be applied to the target document.
|
void |
processDocumentProperties(Map<String,Object> propertiesToAdd)
Receive a map of properties to be added to the target
Document 's properties. |
void |
processDocumentProperty(String key,
Object value)
Receive a key-value-pair to be applied as a user property to the target
Document . |
void |
processPageProperties(int pageIndex,
Map<String,Object> propertiesToAdd)
Receive a map of properties to be added to the target
Page 's properties. |
void |
processPageProperty(int pageIndex,
String key,
Object value)
Receive a key-value-pair to be applied as a user property to the target
Page . |
void |
processPageSegment(PageSegment pageSegment,
int pageIndex,
DocumentLayer layer)
Receive a PageSegment from the format reader.
|
void |
readStarted(int pageIndex)
Signals the fact that a
FormatReader has begun reading the data for a particular page. |
public void readStarted(int pageIndex)
FormatReaderProcessor
FormatReader
has begun reading the data for a particular page.readStarted
in interface FormatReaderProcessor
pageIndex
- the zero-based index of the page within the source stream for which reading
has begunpublic void expectedPageCountDetermined(int totalExpectedPageCount)
FormatReaderProcessor
FormatReader
the opportunity to state in advance how many pages it is going to
read. Not every FormatReader
will be able to provide this information.expectedPageCountDetermined
in interface FormatReaderProcessor
totalExpectedPageCount
- the amount of pages which are going to be read, or
-1
if unknown.public void processPageSegment(PageSegment pageSegment, int pageIndex, DocumentLayer layer)
FormatReaderProcessor
FormatReader
s
whenever they have read a page.processPageSegment
in interface FormatReaderProcessor
pageSegment
- the page segment that has been readpageIndex
- the zero-based index of the page within the source streamlayer
- the layer to which this page segment pertains to. The layer must be one
of the default layers defined in DocumentLayer
.public void attachPageSegment(PageSegment pageSegment, int streamIndex, int pageIndex, DocumentLayer layer)
FormatReaderProcessor
PageSegment
to a page that has been loaded earlier within the same read
operation. The page to which the segment should be attached is identified by the given
streamIndex and pageIndex.attachPageSegment
in interface FormatReaderProcessor
pageSegment
- the page segment that should be attachedstreamIndex
- the zero-based index of the source stream from which a segment on the target
page must have been readpageIndex
- the zero-based index of the page within the source stream from which a segment
on the target page must have been readlayer
- the layer to which this page segment pertains to. The layer must be one
of the default layers defined in DocumentLayer
.public void processDocumentProperty(String key, Object value)
FormatReaderProcessor
Document
. An
existing property under the same key will be replaced.processDocumentProperty
in interface FormatReaderProcessor
key
- the property keyvalue
- the property valuepublic void processDocumentProperties(Map<String,Object> propertiesToAdd)
FormatReaderProcessor
Document
's properties. Existing
properties under identical keys will be replaced.processDocumentProperties
in interface FormatReaderProcessor
propertiesToAdd
- the properties to be addedpublic void processPageProperty(int pageIndex, String key, Object value)
FormatReaderProcessor
Page
. An
existing property under the same key will be replaced.processPageProperty
in interface FormatReaderProcessor
pageIndex
- the zero-based index of the page within the source streamkey
- the property keyvalue
- the property valuepublic void processPageProperties(int pageIndex, Map<String,Object> propertiesToAdd)
FormatReaderProcessor
Page
's properties. Existing
properties under identical keys will be replaced.processPageProperties
in interface FormatReaderProcessor
pageIndex
- the zero-based index of the page within the source streampropertiesToAdd
- the properties to be addedpublic void processDocumentMetadata(Metadata metadata)
FormatReaderProcessor
processDocumentMetadata
in interface FormatReaderProcessor
metadata
- the metadataCopyright © 2024 levigo holding gmbh. All rights reserved.