Package org.apache.nifi.yaml
Class YamlTreeReader
- All Implemented Interfaces:
ConfigurableComponent
,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, timeFormat, timestampFormat
Fields inherited from class org.apache.nifi.serialization.SchemaRegistryService
schemaAccessStrategy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.fasterxml.jackson.core.StreamReadConstraints
Build Stream Read Constraints based on available propertiesprotected RecordSourceFactory
<com.fasterxml.jackson.databind.JsonNode> protected JsonTreeRowRecordReader
createJsonTreeRowRecordReader
(InputStream in, ComponentLog logger, RecordSchema schema) protected List
<PropertyDescriptor> protected boolean
Determine whether to allow comments when parsing based on available propertiesMethods inherited from class org.apache.nifi.json.JsonTreeReader
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, ComponentLog logger, RecordSchema schema) throws IOException, MalformedRecordException - Overrides:
createJsonTreeRowRecordReader
in classJsonTreeReader
- Throws:
IOException
MalformedRecordException
-
buildStreamReadConstraints
protected com.fasterxml.jackson.core.StreamReadConstraints buildStreamReadConstraints(ConfigurationContext context) Description copied from class:JsonTreeReader
Build Stream Read Constraints based on available properties- Overrides:
buildStreamReadConstraints
in classJsonTreeReader
- Parameters:
context
- Configuration Context with property values- Returns:
- Stream Read Constraints
-
isAllowCommentsEnabled
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
-