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.
Modifier and Type | Field and Description |
---|---|
private boolean | |
private boolean | |
protected String | fromPostfix
Part of "from" pattern after the *. |
protected String | fromPrefix
Part of "from" pattern before the *. |
private boolean | |
protected int | postfixLength
Length of the postfix ("from" pattern). |
protected int | prefixLength
Length of the prefix ("from" pattern). |
private boolean | |
protected String | toPostfix
Part of "to" pattern after the *. |
protected String | toPrefix
Part of "to" pattern before the *. |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
protected String | Returns: the variable part of the namethe source file name name)Returns the part of the given string that matches the * in the "from" pattern. |
public boolean | Returns: booleanAttribute specifying whether to ignore the difference between / and \ (the two common directory characters). |
public String[] | Returns: a list of converted filenamesthe filename to map sourceFileName)Implements org. |
private String | Returns: the converted namethe name to convert name)modify string based on dir char mapping and case sensitivity |
public void | setCaseSensitive(boolean
a boolean, default is false. caseSensitive)Attribute specifying whether to ignore the case difference in the names. |
public void | setFrom(String
a string from)Implements org. |
public void | setHandleDirSep(boolean
a boolean, default is false. handleDirSep)Attribute specifying whether to ignore the difference between / and \ (the two common directory characters). |
public void | setTo(String
a string to)Implements org. |
caseSensitive | back to summary |
---|---|
private boolean caseSensitive |
fromContainsStar | back to summary |
---|---|
private boolean fromContainsStar |
fromPostfix | back to summary |
---|---|
protected String fromPostfix Part of "from" pattern after the *. |
fromPrefix | back to summary |
---|---|
protected String fromPrefix Part of "from" pattern before the *. |
handleDirSep | back to summary |
---|---|
private boolean handleDirSep |
postfixLength | back to summary |
---|---|
protected int postfixLength Length of the postfix ("from" pattern). |
prefixLength | back to summary |
---|---|
protected int prefixLength Length of the prefix ("from" pattern). |
toContainsStar | back to summary |
---|---|
private boolean toContainsStar |
toPostfix | back to summary |
---|---|
protected String toPostfix Part of "to" pattern after the *. |
toPrefix | back to summary |
---|---|
protected String toPrefix Part of "to" pattern before the *. |
GlobPatternMapper | back to summary |
---|---|
public GlobPatternMapper() |
extractVariablePart | back to summary |
---|---|
protected String extractVariablePart(String name) Returns the part of the given string that matches the * in the "from" pattern. |
getHandleDirSep | back to summary |
---|---|
public boolean getHandleDirSep() Attribute specifying whether to ignore the difference between / and \ (the two common directory characters).
|
mapFileName | back to summary |
---|---|
public String[] mapFileName(String sourceFileName) Implements org. Returns null if the source file name doesn't match the "from" pattern, an one-element array containing the translated file otherwise. |
modifyName | back to summary |
---|---|
private String modifyName(String name) modify string based on dir char mapping and case sensitivity |
setCaseSensitive | back to summary |
---|---|
public void setCaseSensitive(boolean caseSensitive) Attribute specifying whether to ignore the case difference in the names.
|
setFrom | back to summary |
---|---|
public void setFrom(String from) Implements org. Sets the "from" pattern. Required. |
setHandleDirSep | back to summary |
---|---|
public void setHandleDirSep(boolean handleDirSep) Attribute specifying whether to ignore the difference between / and \ (the two common directory characters).
|
setTo | back to summary |
---|---|
public void setTo(String to) Implements org. Sets the "to" pattern. Required. |