@EventDriven @SideEffectFree @SupportsBatching @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) |
onTrigger
getControllerServiceLookup, getIdentifier, getLogger, initialize, isScheduled, toString, updateScheduledFalse, updateScheduledTrue
equals, getPropertyDescriptor, getPropertyDescriptors, getSupportedDynamicPropertyDescriptor, hashCode, onPropertyModified, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getPropertyDescriptor, getPropertyDescriptors, onPropertyModified, validate
public 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 AbstractConfigurableComponent
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
protected String fillReplacementValueBackReferences(String rawReplacementValue, int numCapturingGroups)
private void updateMapping(ProcessContext context)
protected Map<String,String> loadMappingFile(InputStream is) throws IOException
IOException
Copyright © 2015 Apache NiFi Project. All rights reserved.