@Tags(value={"json","tree","record","reader","parser"}) @CapabilityDescription(value="Parses JSON into individual Record objects. While the reader expects each record to be well-formed JSON, the content of a FlowFile may consist of many records, each as a well-formed JSON array or JSON object with optional whitespace between them, such as the common \'JSON-per-line\' format. If an array is encountered, each element in that array will be treated as a separate record. If the schema that is configured contains a field that is not present in the JSON, a null value will be used. If the JSON contains a field that is not present in the schema, that field will be skipped. See the Usage of the Controller Service for more information and examples.") @SeeAlso(value=JsonPathReader.class) public class JsonTreeReader extends SchemaRegistryService implements RecordReaderFactory
Modifier and Type | Field and Description |
---|---|
private String |
dateFormat |
private String |
timeFormat |
private String |
timestampFormat |
schemaAccessStrategy
Constructor and Description |
---|
JsonTreeReader() |
Modifier and Type | Method and Description |
---|---|
RecordReader |
createRecordReader(Map<String,String> variables,
InputStream in,
long inputLength,
ComponentLog logger) |
protected AllowableValue |
getDefaultSchemaAccessStrategy() |
protected SchemaAccessStrategy |
getSchemaAccessStrategy(String strategy,
SchemaRegistry schemaRegistry,
PropertyContext context) |
protected List<AllowableValue> |
getSchemaAccessStrategyValues() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
void |
storeFormats(ConfigurationContext context) |
buildStrategyProperty, customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAcessStrategyDescriptor, getSuppliedSchemaFields, storeSchemaAccessStrategy
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabled
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
createRecordReader
initialize
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
private volatile String dateFormat
private volatile String timeFormat
private volatile String timestampFormat
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class SchemaRegistryService
@OnEnabled public void storeFormats(ConfigurationContext context)
protected List<AllowableValue> getSchemaAccessStrategyValues()
getSchemaAccessStrategyValues
in class SchemaRegistryService
protected SchemaAccessStrategy getSchemaAccessStrategy(String strategy, SchemaRegistry schemaRegistry, PropertyContext context)
getSchemaAccessStrategy
in class SchemaRegistryService
protected AllowableValue getDefaultSchemaAccessStrategy()
getDefaultSchemaAccessStrategy
in class SchemaRegistryService
public RecordReader createRecordReader(Map<String,String> variables, InputStream in, long inputLength, ComponentLog logger) throws IOException, MalformedRecordException, SchemaNotFoundException
createRecordReader
in interface RecordReaderFactory
IOException
MalformedRecordException
SchemaNotFoundException
Copyright © 2021 Apache NiFi Project. All rights reserved.