@EventDriven @SideEffectFree @SupportsBatching @InputRequirement(value=INPUT_REQUIRED) @Tags(value={"Text","Regular Expression","Update","Change","Replace","Modify","Regex","Mapping"}) @CapabilityDescription(value="Updates the content of a FlowFile by evaluating a Regular Expression against it and replacing the section of the content that matches the Regular Expression with some alternate value provided in a mapping file.") public class ReplaceTextWithMapping extends AbstractProcessor
| Modifier and Type | Class and Description |
|---|---|
static class |
ReplaceTextWithMapping.ConfigurationState |
private class |
ReplaceTextWithMapping.ReplaceTextCallback |
| Modifier and Type | Field and Description |
|---|---|
private Pattern |
backReferencePattern |
static PropertyDescriptor |
CHARACTER_SET |
private AtomicReference<ReplaceTextWithMapping.ConfigurationState> |
configurationStateRef |
private AtomicLong |
lastModified |
static PropertyDescriptor |
MAPPING_FILE |
static PropertyDescriptor |
MAPPING_FILE_REFRESH_INTERVAL |
(package private) AtomicLong |
mappingTestTime |
static PropertyDescriptor |
MATCHING_GROUP_FOR_LOOKUP_KEY |
static PropertyDescriptor |
MAX_BUFFER_SIZE |
private ReentrantLock |
processorLock |
private List<PropertyDescriptor> |
properties |
static PropertyDescriptor |
REGEX |
static Relationship |
REL_FAILURE |
static Relationship |
REL_SUCCESS |
private Set<Relationship> |
relationships |
| Constructor and Description |
|---|
ReplaceTextWithMapping() |
| Modifier and Type | Method and Description |
|---|---|
protected Collection<ValidationResult> |
customValidate(ValidationContext context) |
protected String |
fillReplacementValueBackReferences(String rawReplacementValue,
int numCapturingGroups) |
Set<Relationship> |
getRelationships() |
protected List<PropertyDescriptor> |
getSupportedPropertyDescriptors() |
protected void |
init(ProcessorInitializationContext context) |
protected Map<String,String> |
loadMappingFile(InputStream is) |
void |
onTrigger(ProcessContext context,
ProcessSession session) |
private void |
updateMapping(ProcessContext context) |
onTriggergetControllerServiceLookup, getIdentifier, getLogger, getNodeTypeProvider, initialize, isConfigurationRestored, isScheduled, toString, updateConfiguredRestoredTrue, updateScheduledFalse, updateScheduledTrueequals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validateclone, finalize, getClass, notify, notifyAll, wait, wait, waitisStatefulgetPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validatepublic static final PropertyDescriptor REGEX
public static final PropertyDescriptor MATCHING_GROUP_FOR_LOOKUP_KEY
public static final PropertyDescriptor MAPPING_FILE
public static final PropertyDescriptor MAPPING_FILE_REFRESH_INTERVAL
public static final PropertyDescriptor CHARACTER_SET
public static final PropertyDescriptor MAX_BUFFER_SIZE
public static final Relationship REL_SUCCESS
public static final Relationship REL_FAILURE
private final Pattern backReferencePattern
private List<PropertyDescriptor> properties
private Set<Relationship> relationships
private final ReentrantLock processorLock
private final AtomicLong lastModified
final AtomicLong mappingTestTime
private final AtomicReference<ReplaceTextWithMapping.ConfigurationState> configurationStateRef
protected Collection<ValidationResult> customValidate(ValidationContext context)
customValidate in class AbstractConfigurableComponentprotected void init(ProcessorInitializationContext context)
init in class AbstractSessionFactoryProcessorprotected List<PropertyDescriptor> getSupportedPropertyDescriptors()
getSupportedPropertyDescriptors in class AbstractConfigurableComponentpublic Set<Relationship> getRelationships()
getRelationships in interface ProcessorgetRelationships in class AbstractSessionFactoryProcessorpublic void onTrigger(ProcessContext context, ProcessSession session) throws ProcessException
onTrigger in class AbstractProcessorProcessExceptionprotected String fillReplacementValueBackReferences(String rawReplacementValue, int numCapturingGroups)
private void updateMapping(ProcessContext context)
protected Map<String,String> loadMappingFile(InputStream is) throws IOException
IOExceptionCopyright © 2023 Apache NiFi Project. All rights reserved.