Package org.apache.nifi.yaml
Class YamlTreeReader
java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.controller.AbstractControllerService
org.apache.nifi.serialization.SchemaRegistryService
org.apache.nifi.json.JsonTreeReader
org.apache.nifi.yaml.YamlTreeReader
- All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent
,org.apache.nifi.controller.ControllerService
,RecordReaderFactory
@Tags({"yaml","tree","record","reader","parser"})
@CapabilityDescription("Parses YAML into individual Record objects. While the reader expects each record to be well-formed YAML, the content of a FlowFile may consist of many records, each as a well-formed YAML array or YAML object. 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 YAML, a null value will be used. If the YAML contains a field that is not present in the schema, that field will be skipped. Please note this controller service does not support resolving the use of YAML aliases. Any alias present will be treated as a string. See the Usage of the Controller Service for more information and examples.")
public class YamlTreeReader
extends JsonTreeReader
-
Field Summary
FieldsFields inherited from class org.apache.nifi.json.JsonTreeReader
dateFormat, SCHEMA_APPLICATION_STRATEGY, schemaApplicationStrategy, STARTING_FIELD_NAME, STARTING_FIELD_STRATEGY, startingFieldName, startingFieldStrategy, streamReadConstraints, timeFormat, timestampFormat
Fields inherited from class org.apache.nifi.serialization.SchemaRegistryService
schemaAccessStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected RecordSourceFactory
<com.fasterxml.jackson.databind.JsonNode> protected JsonTreeRowRecordReader
createJsonTreeRowRecordReader
(InputStream in, org.apache.nifi.logging.ComponentLog logger, RecordSchema schema) protected List
<org.apache.nifi.components.PropertyDescriptor> protected boolean
isAllowCommentsEnabled
(org.apache.nifi.controller.ConfigurationContext context) Determine whether to allow comments when parsing based on available propertiesMethods inherited from class org.apache.nifi.json.JsonTreeReader
buildStreamReadConstraints, createRecordReader, getDefaultSchemaAccessStrategy, getSchemaAccessStrategy, getSchemaAccessStrategyValues, storePropertyValues
Methods inherited from class org.apache.nifi.serialization.SchemaRegistryService
buildStrategyProperty, customValidate, getConfigurationContext, getSchema, getSchema, getSchemaAccessStrategy, getSchemaAccessStrategyDescriptor, getSuppliedSchemaFields, migrateProperties, storeSchemaAccessStrategy
Methods inherited from class org.apache.nifi.controller.AbstractControllerService
abstractClearConfigContext, abstractStoreConfigContext, disabled, enabled, getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, getProperty, getStateManager, init, initialize, isEnabled
Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.nifi.components.ConfigurableComponent
getIdentifier, getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
Methods inherited from interface org.apache.nifi.controller.ControllerService
initialize, isStateful, migrateProperties
Methods inherited from interface org.apache.nifi.serialization.RecordReaderFactory
createRecordReader
-
Field Details
-
ALLOW_COMMENTS_DISABLED
private static final boolean ALLOW_COMMENTS_DISABLED- See Also:
-
-
Constructor Details
-
YamlTreeReader
public YamlTreeReader()
-
-
Method Details
-
getSupportedPropertyDescriptors
- Overrides:
getSupportedPropertyDescriptors
in classJsonTreeReader
-
createJsonRecordSourceFactory
protected RecordSourceFactory<com.fasterxml.jackson.databind.JsonNode> createJsonRecordSourceFactory()- Overrides:
createJsonRecordSourceFactory
in classJsonTreeReader
-
createJsonTreeRowRecordReader
protected JsonTreeRowRecordReader createJsonTreeRowRecordReader(InputStream in, org.apache.nifi.logging.ComponentLog logger, RecordSchema schema) throws IOException, MalformedRecordException - Overrides:
createJsonTreeRowRecordReader
in classJsonTreeReader
- Throws:
IOException
MalformedRecordException
-
isAllowCommentsEnabled
protected boolean isAllowCommentsEnabled(org.apache.nifi.controller.ConfigurationContext context) Description copied from class:JsonTreeReader
Determine whether to allow comments when parsing based on available properties- Overrides:
isAllowCommentsEnabled
in classJsonTreeReader
- Parameters:
context
- Configuration Context with property values- Returns:
- Allow comments status
-