Package org.verapdf.processor
Class AbstractBatchProcessor
- java.lang.Object
-
- org.verapdf.processor.AbstractBatchProcessor
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Component
,BatchProcessor
,Processor
- Direct Known Subclasses:
BatchFileProcessor
public abstract class AbstractBatchProcessor extends Object implements BatchProcessor
- Version:
- 0.1 Created 8 Nov 2016:22:58:09
- Author:
- Carl Wilson carlwilson AT github
-
-
Field Summary
Fields Modifier and Type Field Description protected ItemProcessor
processor
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractBatchProcessor(ItemProcessor processor)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
close()
ProcessorConfig
getConfig()
Collection<ReleaseDetails>
getDependencies()
ComponentDetails
getDetails()
BatchSummary
process(File toProcess, boolean recurse, BatchProcessingHandler resultHandler)
Process all .pdf files in a directory, optionally recursively.BatchSummary
process(List<? extends File> toProcess, BatchProcessingHandler resultHandler)
Process a list of PDF filesprotected abstract void
processContainer(File container, boolean recurse)
protected abstract void
processList(List<? extends File> toProcess)
protected void
processResult(ProcessorResult result, Boolean isLogsEnabled)
-
-
-
Field Detail
-
processor
protected final ItemProcessor processor
-
-
Constructor Detail
-
AbstractBatchProcessor
protected AbstractBatchProcessor(ItemProcessor processor)
- See Also:
org.verapdf.processor.BatchProcessor#process(java.io.File, boolean, org.verapdf.processor.ProcessorResultHandler)
-
-
Method Detail
-
getConfig
public ProcessorConfig getConfig()
- Specified by:
getConfig
in interfaceProcessor
- Returns:
- the
ProcessorConfig
that holds the details for the configuration of thisProcessor
- See Also:
Processor.getConfig()
-
getDependencies
public Collection<ReleaseDetails> getDependencies()
- Specified by:
getDependencies
in interfaceProcessor
- Returns:
- a
Collection
ofReleaseDetails
for theProcessor
's dependencies, for auditing. - See Also:
Processor.getDependencies()
-
getDetails
public ComponentDetails getDetails()
- Specified by:
getDetails
in interfaceComponent
- See Also:
Component.getDetails()
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
- See Also:
Closeable.close()
-
process
public BatchSummary process(File toProcess, boolean recurse, BatchProcessingHandler resultHandler) throws VeraPDFException
Description copied from interface:BatchProcessor
Process all .pdf files in a directory, optionally recursively.- Specified by:
process
in interfaceBatchProcessor
- Parameters:
toProcess
- aFile
that denotes a directory to processrecurse
- settrue
to recurse into sub-directories, false if recursion not required.resultHandler
- theBatchProcessingHandler
that will be used to process the results- Returns:
- a
BatchSummary
that reports the details of the batch process - Throws:
VeraPDFException
- when an error occurs during processing.
-
process
public BatchSummary process(List<? extends File> toProcess, BatchProcessingHandler resultHandler) throws VeraPDFException
Description copied from interface:BatchProcessor
Process a list of PDF files- Specified by:
process
in interfaceBatchProcessor
- Parameters:
toProcess
- aList
ofFile
s to processresultHandler
- theBatchProcessingHandler
that will be used to process the results- Returns:
- a
BatchSummary
that reports the details of the batch process - Throws:
VeraPDFException
- when an error occurs during processing.
-
processContainer
protected abstract void processContainer(File container, boolean recurse) throws VeraPDFException
- Throws:
VeraPDFException
-
processList
protected abstract void processList(List<? extends File> toProcess) throws VeraPDFException
- Throws:
VeraPDFException
-
processResult
protected void processResult(ProcessorResult result, Boolean isLogsEnabled) throws VeraPDFException
- Throws:
VeraPDFException
-
-