org.apache.struts.util
public class WildcardHelper extends Object
Since: Struts 1.2
Version: $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $
Field Summary | |
---|---|
protected static int | MATCH_BEGIN The int representing begin in the pattern int [] . |
protected static int | MATCH_END The int value that terminates the pattern int [] . |
protected static int | MATCH_FILE The int representing '*' in the pattern int [] . |
protected static int | MATCH_PATH The int representing '**' in the pattern int [] . |
protected static int | MATCH_THEEND The int representing end in pattern int [] . |
Method Summary | |
---|---|
int[] | compilePattern(String data)
Translate the given String into a int []
representing the pattern matchable by this class.
|
protected int | indexOfArray(int[] r, int rpos, int rend, char[] d, int dpos)
Get the offset of a part of an int array within a char array.
|
protected int | lastIndexOfArray(int[] r, int rpos, int rend, char[] d, int dpos)
Get the offset of a last occurance of an int array within a char array.
|
boolean | match(Map map, String data, int[] expr)
Match a pattern agains a string and isolates wildcard replacement into a
Stack .
|
protected boolean | matchArray(int[] r, int rpos, int rend, char[] d, int dpos)
Matches elements of array r from rpos to rend with array d, starting
from dpos.
|
int []
.int []
.int []
.int []
.int []
.String
into a int []
representing the pattern matchable by this class.
String
into an int array
converting the special '*' and '\' characters.
Parameters: data The string to translate.
Returns: The encoded string as an int array, terminated by the MATCH_END value (don't consider the array length).
Throws: NullPointerException If data is null.
Parameters: r The array containing the data that need to be matched in d. rpos The index of the first character in r to look for. rend The index of the last character in r to look for plus 1. d The array of char that should contain a part of r. dpos The starting offset in d for the matching.
Returns: The offset in d of the part of r matched in d or -1 if that was not found.
Parameters: r The array containing the data that need to be matched in d. rpos The index of the first character in r to look for. rend The index of the last character in r to look for plus 1. d The array of char that should contain a part of r. dpos The starting offset in d for the matching.
Returns: The offset in d of the last part of r matched in d or -1 if that was not found.
Stack
.
Parameters: map The map to store matched values data The string to match expr The compiled wildcard expression
Returns: True if a match
Throws: NullPointerException If any parameters are null
Parameters: r The array containing the data that need to be matched in d. rpos The index of the first character in r to look for. rend The index of the last character in r to look for. d The array of char that should start from a part of r. dpos The starting offset in d for the matching.
Returns: true if array d starts from portion of array r.