@Tags(value={"json","flatten"}) @CapabilityDescription(value="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 \'.\'. Support three kinds of flatten mode, normal, keep-arrays and dot notation for MongoDB query. Default flatten mode is \'keep-arrays\'.") @SideEffectFree public class FlattenJson extends AbstractProcessor
Modifier and Type | Field and Description |
---|---|
static PropertyDescriptor |
FLATTEN_MODE |
static AllowableValue |
FLATTEN_MODE_DOT_NOTATION |
static AllowableValue |
FLATTEN_MODE_KEEP_ARRAYS |
static AllowableValue |
FLATTEN_MODE_NORMAL |
private List<PropertyDescriptor> |
properties |
(package private) static Relationship |
REL_FAILURE |
(package private) static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
(package private) static PropertyDescriptor |
SEPARATOR |
Constructor and Description |
---|
FlattenJson() |
Modifier and Type | Method and Description |
---|---|
private com.github.wnameless.json.flattener.FlattenMode |
getFlattenMode(String mode) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrue
customValidate, equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
static final Relationship REL_SUCCESS
static final Relationship REL_FAILURE
static final PropertyDescriptor SEPARATOR
public static final AllowableValue FLATTEN_MODE_NORMAL
public static final AllowableValue FLATTEN_MODE_KEEP_ARRAYS
public static final AllowableValue FLATTEN_MODE_DOT_NOTATION
public static final PropertyDescriptor FLATTEN_MODE
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
protected void init(ProcessorInitializationContext context)
init
in class AbstractSessionFactoryProcessor
protected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors
in class AbstractConfigurableComponent
public Set<Relationship> getRelationships()
getRelationships
in interface Processor
getRelationships
in class AbstractSessionFactoryProcessor
public void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger
in class AbstractProcessor
ProcessException
private com.github.wnameless.json.flattener.FlattenMode getFlattenMode(String mode)
Copyright © 2020 Apache NiFi Project. All rights reserved.