public abstract class AbstractBaseExtractor extends Object implements Extractor
AbstractBaseExtractor
class implements most of the stuff you need
in order
to implement a full extractor. Handling of item factory, error handling and
destruction (unregistering)
are handled for you.Constructor and Description |
---|
AbstractBaseExtractor(String id) |
Modifier and Type | Method and Description |
---|---|
protected DataItemInputChained |
createInput(String localId) |
protected abstract void |
doProcess(ExecutionResult result)
Process the execution result as input.
|
protected void |
fillNoError(Map<String,Variant> attributes) |
void |
process(ExecutionResult result) |
void |
register(Hive hive,
FolderItemFactory folderItemFactory) |
protected void |
setError(Throwable executionError,
String which)
Set the error flags
|
void |
unregister() |
public AbstractBaseExtractor(String id)
protected DataItemInputChained createInput(String localId)
public void process(ExecutionResult result)
protected void setError(Throwable executionError, String which)
executionError
- the error that occurredprotected abstract void doProcess(ExecutionResult result) throws Exception
This method will only be called if no execution error occurred. Otherwise the error flags of all data items are automatically set.
This method must apply the attributes from fillNoError(Map)
when
updating items. This is needed since applying them afterwards would cause
two updates on the dataitem and the state would by async to the value
itself.
result
- the execution result that has to be processesException
- if anything goes wrongpublic void register(Hive hive, FolderItemFactory folderItemFactory)
public void unregister()
unregister
in interface Extractor