com.levigo.jadice.document
Interface FormatReaderProcessor

All Known Implementing Classes:
AbstractFormatReaderProcessor

public interface FormatReaderProcessor

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.


Method Summary
 void attachPageSegment(PageSegment pageSegment, int streamIndex, int pageIndex, DocumentLayer layer, Map<String,Object> pageProperties, Metadata pageMetadata)
          Attach a PageSegment to a page that has been loaded earlier within the same read operation.
 void expectedPageCountDetermined(int totalExpectedPageCount)
           
 boolean isCancelRequested()
          Return whether the reader shall abort the read.
 void processDocumentMetadata(Metadata metadata)
          Receive document meta-data to be applied to the target document.
 void processDocumentProperty(String key, Object value)
          Receive a key-value-pair to be applied as a user property to the target document.
 void processPageSegment(PageSegment pageSegment, int pageIndex, DocumentLayer layer, Map<String,Object> pageProperties, Metadata pageMetadata)
          Receive a PageSegment from the format reader.
 void readStarted(int pageIndex)
           
 

Method Detail

processPageSegment

void processPageSegment(PageSegment pageSegment,
                        int pageIndex,
                        DocumentLayer layer,
                        Map<String,Object> pageProperties,
                        Metadata pageMetadata)
Receive a PageSegment from the format reader. This method is called by FormatReaders whenever they have read a page.

Parameters:
pageSegment - the page segment that has been read
pageIndex - the zero-based index of the page within the source stream
layer - the layer to which this page segment pertains to. The layer must be one of the default layers defined in DocumentLayer.
pageProperties - a map of page properties to be applied to the target page or null
pageMetadata - the page meta-data to be added to the target page or null
See Also:
DocumentLayer.DEFAULT, DocumentLayer.ANNOTATIONS, DocumentLayer.BACKGROUND, DocumentLayer.FORM

attachPageSegment

void attachPageSegment(PageSegment pageSegment,
                       int streamIndex,
                       int pageIndex,
                       DocumentLayer layer,
                       Map<String,Object> pageProperties,
                       Metadata pageMetadata)
Attach a 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.

Parameters:
pageSegment - the page segment that should be attached
streamIndex - the zero-based index of the source stream from which a segment on the target page must have been read
pageIndex - the zero-based index of the page within the source stream from which a segment on the target page must have been read
layer - the layer to which this page segment pertains to. The layer must be one of the default layers defined in DocumentLayer.
pageProperties - a map of page properties to be applied to the target page or null
pageMetadata - the page meta-data to be added to the target page or null
Throws:
IllegalArgumentException - if there is already a page segment at the identified page and layer.
See Also:
DocumentLayer.DEFAULT, DocumentLayer.ANNOTATIONS, DocumentLayer.BACKGROUND, DocumentLayer.FORM

processDocumentProperty

void processDocumentProperty(String key,
                             Object value)
Receive a key-value-pair to be applied as a user property to the target document.

Parameters:
key - the property key
value - the property value

processDocumentMetadata

void processDocumentMetadata(Metadata metadata)
Receive document meta-data to be applied to the target document.

Parameters:
metadata - the metadata

isCancelRequested

boolean isCancelRequested()
Return whether the reader shall abort the read.

Returns:
true, if the read shall be aborted, false otherwise.

readStarted

void readStarted(int pageIndex)

expectedPageCountDetermined

void expectedPageCountDetermined(int totalExpectedPageCount)


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.