Class FlattenJson

java.lang.Object
org.apache.nifi.components.AbstractConfigurableComponent
org.apache.nifi.processor.AbstractSessionFactoryProcessor
org.apache.nifi.processor.AbstractProcessor
org.apache.nifi.processors.standard.FlattenJson
All Implemented Interfaces:
org.apache.nifi.components.ConfigurableComponent, org.apache.nifi.processor.Processor

@SupportsBatching @InputRequirement(INPUT_REQUIRED) @SideEffectFree @Tags({"json","flatten","unflatten"}) @CapabilityDescription("Provides the user with the ability to take a nested JSON document and flatten it into a simple key/value pair document. The keys are combined at each level with a user-defined separator that defaults to \'.\'. This Processor also allows to unflatten back the flattened json. It supports four kinds of flatten mode such as normal, keep-arrays, dot notation for MongoDB query and keep-primitive-arrays. Default flatten mode is \'keep-arrays\'.") public class FlattenJson extends org.apache.nifi.processor.AbstractProcessor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.AllowableValue
     
    static final org.apache.nifi.components.AllowableValue
     
    static final org.apache.nifi.components.AllowableValue
     
    static final org.apache.nifi.components.AllowableValue
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    private static final List<org.apache.nifi.components.PropertyDescriptor>
     
    static final org.apache.nifi.processor.Relationship
     
    static final org.apache.nifi.processor.Relationship
     
    private static final Set<org.apache.nifi.processor.Relationship>
     
    static final org.apache.nifi.components.PropertyDescriptor
     
    static final String
     
    static final String
     
    static final org.apache.nifi.components.PropertyDescriptor
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private com.github.wnameless.json.flattener.FlattenMode
     
    Set<org.apache.nifi.processor.Relationship>
     
    protected List<org.apache.nifi.components.PropertyDescriptor>
     
    void
    onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session)
     
    private void
    setIgnoreReservedCharacters(boolean ignoreReservedCharacters, com.github.wnameless.json.flattener.JsonFlattener jsonFlattener)
     

    Methods inherited from class org.apache.nifi.processor.AbstractProcessor

    onTrigger

    Methods inherited from class org.apache.nifi.processor.AbstractSessionFactoryProcessor

    getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, init, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue

    Methods inherited from class org.apache.nifi.components.AbstractConfigurableComponent

    customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, 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

    getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate

    Methods inherited from interface org.apache.nifi.processor.Processor

    isStateful, migrateProperties, migrateRelationships
  • Field Details

    • RETURN_TYPE_FLATTEN

      public static final String RETURN_TYPE_FLATTEN
      See Also:
    • RETURN_TYPE_UNFLATTEN

      public static final String RETURN_TYPE_UNFLATTEN
      See Also:
    • FLATTEN_MODE_NORMAL

      public static final org.apache.nifi.components.AllowableValue FLATTEN_MODE_NORMAL
    • FLATTEN_MODE_KEEP_ARRAYS

      public static final org.apache.nifi.components.AllowableValue FLATTEN_MODE_KEEP_ARRAYS
    • FLATTEN_MODE_DOT_NOTATION

      public static final org.apache.nifi.components.AllowableValue FLATTEN_MODE_DOT_NOTATION
    • FLATTEN_MODE_KEEP_PRIMITIVE_ARRAYS

      public static final org.apache.nifi.components.AllowableValue FLATTEN_MODE_KEEP_PRIMITIVE_ARRAYS
    • SEPARATOR

      public static final org.apache.nifi.components.PropertyDescriptor SEPARATOR
    • FLATTEN_MODE

      public static final org.apache.nifi.components.PropertyDescriptor FLATTEN_MODE
    • IGNORE_RESERVED_CHARACTERS

      public static final org.apache.nifi.components.PropertyDescriptor IGNORE_RESERVED_CHARACTERS
    • RETURN_TYPE

      public static final org.apache.nifi.components.PropertyDescriptor RETURN_TYPE
    • CHARACTER_SET

      public static final org.apache.nifi.components.PropertyDescriptor CHARACTER_SET
    • PRETTY_PRINT

      public static final org.apache.nifi.components.PropertyDescriptor PRETTY_PRINT
    • PROPERTY_DESCRIPTORS

      private static final List<org.apache.nifi.components.PropertyDescriptor> PROPERTY_DESCRIPTORS
    • REL_SUCCESS

      public static final org.apache.nifi.processor.Relationship REL_SUCCESS
    • REL_FAILURE

      public static final org.apache.nifi.processor.Relationship REL_FAILURE
    • RELATIONSHIPS

      private static final Set<org.apache.nifi.processor.Relationship> RELATIONSHIPS
  • Constructor Details

    • FlattenJson

      public FlattenJson()
  • Method Details

    • getSupportedPropertyDescriptors

      protected List<org.apache.nifi.components.PropertyDescriptor> getSupportedPropertyDescriptors()
      Overrides:
      getSupportedPropertyDescriptors in class org.apache.nifi.components.AbstractConfigurableComponent
    • getRelationships

      public Set<org.apache.nifi.processor.Relationship> getRelationships()
      Specified by:
      getRelationships in interface org.apache.nifi.processor.Processor
      Overrides:
      getRelationships in class org.apache.nifi.processor.AbstractSessionFactoryProcessor
    • onTrigger

      public void onTrigger(org.apache.nifi.processor.ProcessContext context, org.apache.nifi.processor.ProcessSession session) throws org.apache.nifi.processor.exception.ProcessException
      Specified by:
      onTrigger in class org.apache.nifi.processor.AbstractProcessor
      Throws:
      org.apache.nifi.processor.exception.ProcessException
    • getFlattenMode

      private com.github.wnameless.json.flattener.FlattenMode getFlattenMode(String mode)
    • setIgnoreReservedCharacters

      private void setIgnoreReservedCharacters(boolean ignoreReservedCharacters, com.github.wnameless.json.flattener.JsonFlattener jsonFlattener)