|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.maven.shared.model.fileset.mappers.GlobPatternMapper
public class GlobPatternMapper
Implementation of FileNameMapper that does simple wildcard pattern replacements.
This does simple translations like *.foo -> *.bar where the prefix to .foo will be left unchanged. It only handles a single * character, use regular expressions for more complicated situations.
This is one of the more useful Mappers, it is used by javac for example.
Field Summary | |
---|---|
protected String |
fromPostfix
Part of "from" pattern after the *. |
protected String |
fromPrefix
Part of "from" pattern before the *. |
protected int |
postfixLength
Length of the postfix ("from" pattern). |
protected int |
prefixLength
Length of the prefix ("from" pattern). |
protected String |
toPostfix
Part of "to" pattern after the *. |
protected String |
toPrefix
Part of "to" pattern before the *. |
Constructor Summary | |
---|---|
GlobPatternMapper()
|
Method Summary | |
---|---|
protected String |
extractVariablePart(String name)
Returns the part of the given string that matches the * in the "from" pattern. |
String |
mapFileName(String sourceFileName)
Returns the target filename for the given source file. |
void |
setCaseSensitive(boolean caseSensitive)
Attribute specifing whether to ignore the case difference in the names. |
void |
setFrom(String from)
Sets the from part of the transformation rule. |
void |
setHandleDirSep(boolean handleDirSep)
Attribute specifing whether to ignore the difference between / and \ (the two common directory characters). |
void |
setTo(String to)
Sets the to part of the transformation rule. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String fromPrefix
protected String fromPostfix
protected int prefixLength
protected int postfixLength
protected String toPrefix
protected String toPostfix
Constructor Detail |
---|
public GlobPatternMapper()
Method Detail |
---|
public void setHandleDirSep(boolean handleDirSep)
handleDirSep
- a boolean, default is false.public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- a boolean, default is false.public void setFrom(String from)
setFrom
in interface FileNameMapper
public void setTo(String to)
setTo
in interface FileNameMapper
public String mapFileName(String sourceFileName)
if the given rule doesn't apply to the source file, implementation must return null. SourceFileScanner will then omit the source file in question.
mapFileName
in interface FileNameMapper
sourceFileName
- the name of the source file relative to some given basedirectory.
protected String extractVariablePart(String name)
name
- the source file name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |