public class NumberFormatTransformer extends Transformer
A Transformer
instance which can extract numbers out of strings. It uses
NumberFormat
class to parse strings and supports
Number, Integer, Currency and Percent styles as supported by
NumberFormat
with configurable locales.
Refer to http://wiki.apache.org/solr/DataImportHandler for more details.
This API is experimental and may change in the future.
Modifier and Type | Field and Description |
---|---|
static String |
CURRENCY |
static String |
FORMAT_STYLE |
static String |
INTEGER |
static String |
LOCALE |
static String |
NUMBER |
static String |
PERCENT |
Constructor and Description |
---|
NumberFormatTransformer() |
Modifier and Type | Method and Description |
---|---|
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 static final String FORMAT_STYLE
public static final String LOCALE
public static final String NUMBER
public static final String PERCENT
public static final String INTEGER
public static final String CURRENCY
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
>>Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.