Class RegExpFileMapper
- java.lang.Object
-
- org.codehaus.plexus.components.io.filemappers.AbstractFileMapper
-
- org.codehaus.plexus.components.io.filemappers.RegExpFileMapper
-
- All Implemented Interfaces:
FileMapper
public class RegExpFileMapper extends AbstractFileMapper
Implementation of a file mapper, which uses regular expressions.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.regex.Pattern
pattern
private boolean
replaceAll
private java.lang.String
replacement
static java.lang.String
ROLE_HINT
The regexp mappers role-hint: "regexp".-
Fields inherited from interface org.codehaus.plexus.components.io.filemappers.FileMapper
DEFAULT_ROLE_HINT, ROLE
-
-
Constructor Summary
Constructors Constructor Description RegExpFileMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getMappedFileName(java.lang.String pName)
Checks the input and returns it without modifications.java.lang.String
getPattern()
Returns the regular expression pattern.boolean
getReplaceAll()
Returns, whether to replace the first occurrence of the pattern (default), or all.java.lang.String
getReplacement()
Returns the replacement string.void
setPattern(java.lang.String pPattern)
Sets the regular expression pattern.void
setReplaceAll(boolean pReplaceAll)
Sets, whether to replace the first occurrence of the pattern (default), or all.void
setReplacement(java.lang.String pReplacement)
Sets the replacement string.
-
-
-
Field Detail
-
ROLE_HINT
public static final java.lang.String ROLE_HINT
The regexp mappers role-hint: "regexp".- See Also:
- Constant Field Values
-
pattern
private java.util.regex.Pattern pattern
-
replacement
private java.lang.String replacement
-
replaceAll
private boolean replaceAll
-
-
Method Detail
-
setPattern
public void setPattern(java.lang.String pPattern)
Sets the regular expression pattern.
-
getPattern
public java.lang.String getPattern()
Returns the regular expression pattern.
-
setReplacement
public void setReplacement(java.lang.String pReplacement)
Sets the replacement string.
-
getReplacement
public java.lang.String getReplacement()
Returns the replacement string.
-
getReplaceAll
public boolean getReplaceAll()
Returns, whether to replace the first occurrence of the pattern (default), or all.
-
setReplaceAll
public void setReplaceAll(boolean pReplaceAll)
Sets, whether to replace the first occurrence of the pattern (default), or all.
-
getMappedFileName
@Nonnull public java.lang.String getMappedFileName(@Nonnull java.lang.String pName)
Description copied from class:AbstractFileMapper
Checks the input and returns it without modifications.- Specified by:
getMappedFileName
in interfaceFileMapper
- Overrides:
getMappedFileName
in classAbstractFileMapper
- Parameters:
pName
- The source name.- Returns:
- The target name.
-
-