public class FieldReplacer
extends java.lang.Object
Constructor and Description |
---|
FieldReplacer(java.lang.String fieldName,
java.lang.String pattern,
java.lang.String replacement,
java.lang.Integer flags)
Field replacer with the input and output field the same.
|
FieldReplacer(java.lang.String fieldName,
java.lang.String toFieldName,
java.lang.String pattern,
java.lang.String replacement,
java.lang.Integer flags)
Create a FieldReplacer for a field.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
checkAndReplace(java.lang.String fieldName,
java.lang.String value)
Return a replacement value for a field.
|
java.lang.String |
getFieldName() |
java.util.regex.Pattern |
getPattern() |
java.lang.String |
getReplacement() |
java.lang.String |
getToFieldName() |
boolean |
isValid()
Does this FieldReplacer have a valid fieldname and pattern?
|
java.lang.String |
replace(java.lang.String value)
Return the replacement value for a field value.
|
public FieldReplacer(java.lang.String fieldName, java.lang.String toFieldName, java.lang.String pattern, java.lang.String replacement, java.lang.Integer flags)
fieldName
- the name of the source field to operate on. Required.toFieldName
- the name of the target field. Required.pattern
- the pattern the field must match. Required.replacement
- the replacement stringflags
- the Pattern flags value, or null if no flags are neededpublic FieldReplacer(java.lang.String fieldName, java.lang.String pattern, java.lang.String replacement, java.lang.Integer flags)
fieldName
- pattern
- replacement
- flags
- public java.lang.String getFieldName()
public java.lang.String getToFieldName()
public java.util.regex.Pattern getPattern()
public java.lang.String getReplacement()
public boolean isValid()
public java.lang.String replace(java.lang.String value)
value
- public java.lang.String checkAndReplace(java.lang.String fieldName, java.lang.String value)
fieldName
- the name of the field you are checkingvalue
- the value of the field you are checkingCopyright © 2018 The Apache Software Foundation