com.levigo.jadice.document.read.fluent
Interface TaskBuilder


public interface TaskBuilder

Constructs a self contained part of the Document reading process. The TaskBuilder will construct a completely configured and independent reading task which may be used in conjunction with DocumentBuilder and Read

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.


Method Summary
 TaskBuilder add(InputStream stream)
           
 TaskBuilder add(Provider<? extends InputStream,IOException> stream)
           
 LayerMappingBuilder<TaskBuilder> map(DocumentLayer from)
          Initiate a layer mapping definition using the given from DocumentLayer.
 LayerMappingBuilder<TaskBuilder> map(String from)
          Initiate a layer mapping definition using the given from layer name.
 LayerMappingBuilder<TaskBuilder> mapAnnotationsLayer()
          Initiate a layer mapping definition using the annotation layer.
 LayerMappingBuilder<TaskBuilder> mapBackgroundLayer()
          Initiate a layer mapping definition using the background layer .
 LayerMappingBuilder<TaskBuilder> mapDefaultLayer()
          Initiate a layer mapping definition using the default layer.
 LayerMappingBuilder<TaskBuilder> mapFormLayer()
          Initiate a layer mapping definition using the form layer.
 TaskBuilder property(String key, Object value)
          Associate a property with the task being constructed.
 TaskBuilder skip(int pageCountToBeSkipped)
          Skips the given number of pages.
 TaskBuilder using(Class<? extends Format> clazz)
          Specifies the Format which shall be used.
 TaskBuilder using(Format format)
          Specifies the Format which shall be used.
 TaskBuilder with(ReaderControls controls)
          Specify the ReaderControls to be used for this task.
 

Method Detail

add

TaskBuilder add(Provider<? extends InputStream,IOException> stream)

add

TaskBuilder add(InputStream stream)

map

LayerMappingBuilder<TaskBuilder> map(DocumentLayer from)
Initiate a layer mapping definition using the given from DocumentLayer. LayerMappingBuilder will provide to* methods to specify the mapping target.

Parameters:
from - the source DocumentLayer to map from.
Returns:
returns an LayerMappingBuilder instance to allow fluent API use. For details please see Read
Throws:
IllegalArgumentException - if from is null

mapDefaultLayer

LayerMappingBuilder<TaskBuilder> mapDefaultLayer()
Initiate a layer mapping definition using the default layer. LayerMappingBuilder will provide to* methods to specify the mapping target.

Returns:
returns an LayerMappingBuilder instance to allow fluent API use. For details please see Read

mapBackgroundLayer

LayerMappingBuilder<TaskBuilder> mapBackgroundLayer()
Initiate a layer mapping definition using the background layer . LayerMappingBuilder will provide to* methods to specify the mapping target.

Returns:
returns an LayerMappingBuilder instance to allow fluent API use. For details please see Read

mapAnnotationsLayer

LayerMappingBuilder<TaskBuilder> mapAnnotationsLayer()
Initiate a layer mapping definition using the annotation layer. LayerMappingBuilder will provide to* methods to specify the mapping target.

Returns:
returns an LayerMappingBuilder instance to allow fluent API use. For details please see Read

mapFormLayer

LayerMappingBuilder<TaskBuilder> mapFormLayer()
Initiate a layer mapping definition using the form layer. LayerMappingBuilder will provide to* methods to specify the mapping target.

Returns:
returns an LayerMappingBuilder instance to allow fluent API use. For details please see Read

map

LayerMappingBuilder<TaskBuilder> map(String from)
Initiate a layer mapping definition using the given from layer name. LayerMappingBuilder will provide to* methods to specify the mapping target. This method is a shortcut for map(DocumentLayer.get(from))

Parameters:
from - the source DocumentLayer to map from.
Returns:
returns an LayerMappingBuilder instance to allow fluent API use. For details please see Read
Throws:
IllegalArgumentException - if from is null

using

TaskBuilder using(Format format)
Specifies the Format which shall be used.

Parameters:
format - the format to be used.
Returns:
returns an TaskBuilder instance to allow fluent API use. For details please see Read

using

TaskBuilder using(Class<? extends Format> clazz)
Specifies the Format which shall be used.
The lookup for a concrete instance of the specified Format Class is done in two steps:
  1. Lookup a existing instance of the specified Format in the FormatRegistry
  2. If no existing instance could be found, try to instantiiate the Format Class using the default constructor.

Parameters:
clazz - the Class of the Format to be used.
Returns:
returns an TaskBuilder instance to allow fluent API use. For details please see Read
Throws:
IllegalArgumentException - if clazz is null or no Format instance could be found in the FormatRegistry and instantiating using the default constructor failed.

with

TaskBuilder with(ReaderControls controls)
Specify the ReaderControls to be used for this task. This will override the inherited defaults from ReadConfigurer.

Parameters:
controls - the controls to be used.
Returns:
returns an TaskBuilder instance to allow fluent API use. For details please see Read

skip

TaskBuilder skip(int pageCountToBeSkipped)
Skips the given number of pages. This may be used to leave pages empty.

Example:
add(...).skip(5).add(...)
The code above will load all pages of the data specified in the first add(...), leave five pages unattended (not adding any content), and finally adding the data of the second add(...).

This is particularly useful if page-wise annotation loading is required and some pages are not annotated at all.

Parameters:
pageCountToBeSkipped - the number of pages to be skipped.
Returns:
returns an TaskBuilder instance to allow fluent API use. For details please see Read

property

TaskBuilder property(String key,
                     Object value)
Associate a property with the task being constructed. These properties will be available on all PageSegmentSource instanced of all PageSegments created during the execution of this task and may therefore be used to transport integration internal properties

Parameters:
key -
value -
Returns:
returns an TaskBuilder instance to allow fluent API use. For details please see Read


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