public interface FormatReaderProcessor
FormatReader
. A typical
implementation would gather the resulting objects in an instance of Document
.
Caveat: levigo reserves the right to add methods to this interface with future releases.
Therefore we strongly recommend sub-classing AbstractFormatReaderProcessor
instead of
directly implementing this interface. Doing so shields implementors from the need to extend their
implementations should this interface be extended.
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. |
void readStarted(int pageIndex)
FormatReader
has begun reading the data for a particular page.pageIndex
- the zero-based index of the page within the source stream for which reading
has begunvoid expectedPageCountDetermined(int totalExpectedPageCount)
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.totalExpectedPageCount
- the amount of pages which are going to be read, or
-1
if unknown.void processPageSegment(PageSegment pageSegment, int pageIndex, DocumentLayer layer)
FormatReader
s
whenever they have read a page.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
.void attachPageSegment(PageSegment pageSegment, int streamIndex, int pageIndex, DocumentLayer layer)
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.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
.IllegalArgumentException
- if there is already a page segment at the identified page and
layer.void processDocumentMetadata(Metadata metadata)
metadata
- the metadatavoid processDocumentProperty(String key, Object value)
Document
. An
existing property under the same key will be replaced.key
- the property keyvalue
- the property valuevoid processDocumentProperties(Map<String,Object> propertiesToAdd)
Document
's properties. Existing
properties under identical keys will be replaced.propertiesToAdd
- the properties to be addedvoid processPageProperty(int pageIndex, String key, Object value)
Page
. An
existing property under the same key will be replaced.pageIndex
- the zero-based index of the page within the source streamkey
- the property keyvalue
- the property valuevoid processPageProperties(int pageIndex, Map<String,Object> propertiesToAdd)
Page
's properties. Existing
properties under identical keys will be replaced.pageIndex
- the zero-based index of the page within the source streampropertiesToAdd
- the properties to be addedCopyright © 2024 levigo holding gmbh. All rights reserved.