|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.read.fluent.ReadConfiguration
public abstract class ReadConfiguration
A base class for reusable read configurations
.
Constructor Summary | |
---|---|
ReadConfiguration()
|
Method Summary | ||
---|---|---|
protected void |
add(ReadConfiguration... readConfigurations)
Add additional ReadConfiguration s. |
|
void |
configure(ReadConfigurer rc)
Configure the ReadConfiguration for the given ReadConfigurer . |
|
protected
|
defaultControls(Class<T> settingsClass)
Access ReaderSettings which will be used by subsequent task
creations. |
|
protected LayerMappingBuilder<ReadConfigurer> |
defaultLayerMapping(DocumentLayer from)
Generate a default layer mapping which will be used by subsequent
task creations. |
|
protected LayerMappingBuilder<ReadConfigurer> |
defaultLayerMapping(String from)
Generate a default layer mapping which will be used by subsequent
task creations. |
|
protected abstract void |
doConfigure()
doConfigure() implementations may configure the reading process using the methods
defined in this base class (except configure(ReadConfigurer) and
doConfigure() ). |
|
protected DocumentBuilder |
into(Document doc)
Configure a Document as the target for reading. |
|
protected DocumentBuilder |
newDocument()
Create a new Document . |
|
protected DocumentBuilder |
newDocument(String documentName)
Create a new Document and set a name . |
|
protected TaskBuilder |
skip(int pageCountToBeSkipped)
Start a task which skips the given number of pages. |
|
protected TaskBuilder |
task(InputStream source)
Start a task which uses the given source to load pages
from. |
|
protected TaskBuilder |
task(Provider<? extends InputStream,IOException> sourceProvider)
Start a task which uses the given source to load pages
from. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReadConfiguration()
Method Detail |
---|
public final void configure(ReadConfigurer rc)
ReadConfiguration
for the given ReadConfigurer
. This method is
synchronized by intention, as during the configuration a ReadConfiguration
is stateful.
Once configure(ReadConfigurer)
is left, the ReadConfiguration
is stateless
again.
rc
- the ReadConfigurer
which shall be configured.protected abstract void doConfigure()
doConfigure()
implementations may configure the reading process using the methods
defined in this base class (except configure(ReadConfigurer)
and
doConfigure()
).
protected final 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
protected final 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
protected final 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
protected 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
protected 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
protected 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
protected void add(ReadConfiguration... readConfigurations)
ReadConfiguration
s.
readConfigurations
- the ReadConfiguration
s to includeprotected <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 configure
RenderSettings
implementationprotected LayerMappingBuilder<ReadConfigurer> defaultLayerMapping(DocumentLayer from)
layer mapping
which will be used by subsequent
task
creations.
from
- the source layer to build the mapping from
LayerMappingBuilder
instanceprotected LayerMappingBuilder<ReadConfigurer> defaultLayerMapping(String from)
layer mapping
which will be used by subsequent
task
creations.
from
- the source layer to build the mapping from
LayerMappingBuilder
instance
IllegalArgumentException
- if from
is null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |