IN
- Type of the input elements.OUT
- Type of the returned elements.public abstract class JSONParseFlatMap<IN,OUT> extends RichFlatMapFunction<IN,OUT>
RichFlatMapFunction
to handle JSON files.Constructor and Description |
---|
JSONParseFlatMap() |
Modifier and Type | Method and Description |
---|---|
Object |
get(String jsonText,
String field)
Get the value object associated with a key form a JSON code.
|
boolean |
getBoolean(String jsonText,
String field)
Get the boolean value associated with a key form a JSON code.
|
double |
getDouble(String jsonText,
String field)
Get the double value associated with a key form a JSON code.
|
int |
getInt(String jsonText,
String field)
Get the int value associated with a key form a JSON code.
|
long |
getLong(String jsonText,
String field)
Get the long value associated with a key form a JSON code.
|
String |
getString(String jsonText,
String field)
Get the String value associated with a key form a JSON code.
|
flatMap
close, getIterationRuntimeContext, getRuntimeContext, open, setRuntimeContext
public Object get(String jsonText, String field) throws org.apache.sling.commons.json.JSONException
jsonText
- JSON String in which the field is searched.field
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the field is not found.public boolean getBoolean(String jsonText, String field) throws org.apache.sling.commons.json.JSONException
jsonText
- JSON String in which the field is searched.field
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the field is not found.public double getDouble(String jsonText, String field) throws org.apache.sling.commons.json.JSONException
jsonText
- JSON String in which the field is searched.field
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the field is not found.public int getInt(String jsonText, String field) throws org.apache.sling.commons.json.JSONException
jsonText
- JSON String in which the field is searched.field
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the field is not found.public long getLong(String jsonText, String field) throws org.apache.sling.commons.json.JSONException
jsonText
- JSON String in which the field is searched.field
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the field is not found.public String getString(String jsonText, String field) throws org.apache.sling.commons.json.JSONException
jsonText
- JSON String in which the field is searched.field
- The key whose value is searched for.org.apache.sling.commons.json.JSONException
- If the field is not found.Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.