public class ScriptTransformer extends Transformer
A Transformer
instance capable of executing functions written in scripting
languages as a Transformer
instance.
Refer to http://wiki.apache.org/solr/DataImportHandler for more details.
This API is experimental and may change in the future.Constructor and Description |
---|
ScriptTransformer() |
Modifier and Type | Method and Description |
---|---|
String |
getFunctionName() |
void |
setFunctionName(String methodName) |
Object |
transformRow(Map<String,Object> row,
Context context)
The input is a row of data and the output has to be a new row.
|
public Object transformRow(Map<String,Object> row, Context context)
Transformer
transformRow
in class Transformer
row
- A row of datacontext
- The current contextMap
<String
, Object
> if it returns
only one row or if there are multiple rows to be returned it must
be a List
<Map
<String
, Object
>>public void setFunctionName(String methodName)
public String getFunctionName()