public class ContentTypeDetectorStreamProcessor extends Object implements DetectorStreamProcessor
DetectorStreamProcessor
that allows to
detect a ContentTypeBean
using DecisionTreeNode
. Modifier and Type | Class and Description |
---|---|
private static class |
ContentTypeDetectorStreamProcessor.DecisionState |
Modifier and Type | Field and Description |
---|---|
private List<ContentTypeBean> |
contentTypes |
private List<ContentTypeDetectorStreamProcessor.DecisionState> |
stateList |
Constructor and Description |
---|
ContentTypeDetectorStreamProcessor(List<ContentTypeBean> contentTypes)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
detectInitially(ContentTypeBean contentType) |
void |
process(DetectorStreamBuffer buffer,
Map<String,Object> metadata,
boolean eos)
This method performs the actual detection and optionally manipulates the data.
|
private final List<ContentTypeBean> contentTypes
private List<ContentTypeDetectorStreamProcessor.DecisionState> stateList
public ContentTypeDetectorStreamProcessor(List<ContentTypeBean> contentTypes)
rootNode
- is the the top-level DecisionTreeNode
.public void process(DetectorStreamBuffer buffer, Map<String,Object> metadata, boolean eos) throws IOException
buffer
that provides access to read buffered parts of the stream. As streams are
typically larger pieces of data, this method will be called repetitive in order to process the entire
stream. buffer
whenever
it is invoked. To ensure your implementation can always make an appropriate decision it may have to
ensure a specific lookahead
.process
in interface DetectorStreamProcessor
buffer
- allows you to read parts of the streamed data as well as to manipulate the data.metadata
- is the Map
with the meta-data.eos
- - true
if the end of the stream has been reached and the given
buffer
has to beIOException
- in case of an Input/Output error. Should only be used internally.protected void detectInitially(ContentTypeBean contentType)
Copyright © 2001–2014 mmm-Team. All rights reserved.