public class AlgorithmExtractor extends java.lang.Object implements Extractor<LocalAbstractObject>
Extractor
that creates objects by
executing a SingletonQueryOperation
. The type of the query
operation as well as its parameters are specified in the constructor.
Note that the parameters map of the ExtractorDataSource
is
used as the named instances map, so the parameters can be used as the
operation arguments.Constructor and Description |
---|
AlgorithmExtractor(Algorithm algorithm,
java.lang.Class<? extends SingletonQueryOperation> operationClass,
java.lang.String... operationArguments)
Creates a new instance of algorithm extractor.
|
Modifier and Type | Method and Description |
---|---|
LocalAbstractObject |
extract(ExtractorDataSource dataSource)
Extracts the
LocalAbstractObject from the specified binary data. |
java.lang.Class<? extends LocalAbstractObject> |
getExtractedClass()
Returns the object class extracted by this extractor.
|
public AlgorithmExtractor(Algorithm algorithm, java.lang.Class<? extends SingletonQueryOperation> operationClass, java.lang.String... operationArguments) throws java.lang.NoSuchMethodException
algorithm
- the algorithm on which to execute the operationoperationClass
- the class of the operation that is executedoperationArguments
- the operation string arguments (converted when the operation is executed)java.lang.NoSuchMethodException
- if the operation constructor is not found for the given number of argumentspublic LocalAbstractObject extract(ExtractorDataSource dataSource) throws ExtractorException, java.io.IOException
Extractor
LocalAbstractObject
from the specified binary data.extract
in interface Extractor<LocalAbstractObject>
dataSource
- the source of binary data for the extractionExtractorException
- if the extractor encountered problem
extracting the object from the binary datajava.io.IOException
- if there was a problem reading data from the dataSource
public java.lang.Class<? extends LocalAbstractObject> getExtractedClass()
Extractor
getExtractedClass
in interface Extractor<LocalAbstractObject>