public interface ReadConfigurer
ReadConfigurer
is the main point of interaction with the fluent read API and the
reading process. The ReadConfigurer
provides APIs to:
defaultControls(Class)
,
defaultLayerMapping(DocumentLayer)
)Document
s (newDocument()
, newDocument(String)
)Document
s (into(Document)
)tasks
( task(InputStream)
, task(Provider)
,
skip(int)
)Document
s (getFirstDocument()
,
getRegisteredDocuments()
).IMPORTANT: This interface is used as a public part of the fluent read API. It is not designed to be implemented and must not be implemented by clients.
Modifier and Type | Method and Description |
---|---|
ReadConfigurer |
add(ReadConfiguration... readConfigurations)
Add existing
ReadConfiguration s. |
<T extends ReaderSettings> |
defaultControls(Class<T> settingsClass)
Access
ReaderSettings which will be used by subsequent task
creations. |
LayerMappingBuilder<ReadConfigurer> |
defaultLayerMapping(DocumentLayer from)
Generate a default
layer mapping which will be used by subsequent
task creations. |
LayerMappingBuilder<ReadConfigurer> |
defaultLayerMapping(String from)
Generate a default
layer mapping which will be used by subsequent
task creations. |
Document |
getFirstDocument()
Returns the first
registered document . |
List<Document> |
getRegisteredDocuments()
Returns all with this
ReadConfigurer registered Document s. |
DocumentBuilder |
into(Document doc)
Configure a
Document as the target for reading. |
DocumentBuilder |
newDocument()
Create a new
Document . |
DocumentBuilder |
newDocument(String documentName)
|
TaskBuilder |
skip(int pageCountToBeSkipped)
Start a
task which skips the given number of pages. |
TaskBuilder |
task(InputStream source)
|
TaskBuilder |
task(Provider<? extends InputStream,IOException> sourceProvider)
|
ReadConfigurer add(ReadConfiguration... readConfigurations)
ReadConfiguration
s. These ReadConfiguration
s provide a modularized
way to generate Document
s.readConfigurations
- the ReadConfiguration
s to includeReadConfigurer
instance to allow fluent API use. For details please
see Read
Read
<T extends ReaderSettings> T defaultControls(Class<T> settingsClass)
ReaderSettings
which will be used by subsequent task
creations. This method works like ProcessingControls.getSettings(Class)
.T
- the target RenderSettings
type to be configured.settingsClass
- the target RenderSettings
class to configureRenderSettings
implementationLayerMappingBuilder<ReadConfigurer> defaultLayerMapping(DocumentLayer from)
layer mapping
which will be used by subsequent
task
creations.from
- the source layer to build the mapping fromLayerMappingBuilder
instanceLayerMappingBuilder<ReadConfigurer> defaultLayerMapping(String from)
layer mapping
which will be used by subsequent
task
creations.from
- the source layer to build the mapping fromLayerMappingBuilder
instanceIllegalArgumentException
- if from
is null
Document getFirstDocument()
registered document
. A Document
will be registered once a DocumentBuilder
is created, for example using the methods
into(Document)
, newDocument()
or newDocument(String)
.
This method is a shortcut for the following code:
Document
doc = null;
List<Document>
registered = getRegisteredDocuments()
;
if (registered.size()
> 0) {
doc = registered.get(0)
;
}
List<Document> getRegisteredDocuments()
ReadConfigurer
registered Document
s. A Document
will be registered once a DocumentBuilder
is created, for example using the methods
into(Document)
, newDocument()
or newDocument(String)
.List
of all registered documents. This method will never return
null
, instead it returns a empty list.DocumentBuilder into(Document doc)
Document
as the target for reading. Unlike the newDocument()
and
newDocument(String)
methods, this method uses an existing Document
and adds
all loaded Page
s to the end.doc
- the Document
to append Page
s to.DocumentBuilder
instance to allow fluent API use. For details please
see Read
DocumentBuilder newDocument()
Document
. The returned DocumentBuilder
will be liked to that newly
created Document
and all instructions on DocumentBuilder
will affect the
generated Document
.DocumentBuilder
instance to allow fluent API use. For details please
see Read
DocumentBuilder newDocument(String documentName)
Document
and set a name
. The returned
DocumentBuilder
will be liked to that newly created Document
and all
instructions on DocumentBuilder
will affect the generated Document
.documentName
- the name
of the new Document
DocumentBuilder
instance to allow fluent API use. For details please
see Read
TaskBuilder task(InputStream source)
task
which uses the given source
to load pages
from. A task
can be configured further using the methods of
TaskBuilder
.
The resulting task will inherit all previously via defaultControls(Class)
and
defaultLayerMapping(DocumentLayer)
configured defaults.
source
- the source
to load pages from.TaskBuilder
instance to allow fluent API use. For details please see
Read
TaskBuilder task(Provider<? extends InputStream,IOException> sourceProvider)
task
which uses the given source
to load pages
from. A task
can be configured further using the methods of
TaskBuilder
.
The resulting task will inherit all previously via defaultControls(Class)
and
defaultLayerMapping(DocumentLayer)
configured defaults.
sourceProvider
- provides an InputStream
to load pages from.TaskBuilder
instance to allow fluent API use. For details please see
Read
TaskBuilder skip(int pageCountToBeSkipped)
task
which skips the given number of pages. For details about the
behavior of skip(int)
please see TaskBuilder.skip(int)
.
The resulting task will inherit all previously via defaultControls(Class)
and
defaultLayerMapping(DocumentLayer)
configured defaults.
pageCountToBeSkipped
- the number of pages to be skipped.TaskBuilder
instance to allow fluent API use. For details please see
Read
Copyright © 2024 levigo holding gmbh. All rights reserved.