|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--org.apache.cocoon.matching.helpers.WildcardHelper
This class is an utility class that perform wilcard-patterns matching and isolation.
| 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 []. |
| Constructor Summary | |
WildcardHelper()
|
|
| Method Summary | |
static int[] |
compilePattern(java.lang.String data)
Translate the given String into a int []
representing the pattern matchable by this class.
|
protected static 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 static 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. |
static boolean |
match(java.util.HashMap map,
java.lang.String data,
int[] expr)
match a pattern agains a string and isolates wildcard replacement into a Stack. |
protected static 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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int MATCH_FILE
int [].protected static final int MATCH_PATH
int [].protected static final int MATCH_BEGIN
int [].protected static final int MATCH_THEEND
int [].protected static final int MATCH_END
int [].| Constructor Detail |
public WildcardHelper()
| Method Detail |
public static int[] compilePattern(java.lang.String data)
throws java.lang.NullPointerException
String into a int []
representing the pattern matchable by this class.
String into an int array
converting the special '*' and '\' characters.
data - The string to translate.java.lang.NullPointerException - If data is null.
public static boolean match(java.util.HashMap map,
java.lang.String data,
int[] expr)
throws java.lang.NullPointerException
Stack.
protected static int indexOfArray(int[] r,
int rpos,
int rend,
char[] d,
int dpos)
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.
protected static int lastIndexOfArray(int[] r,
int rpos,
int rend,
char[] d,
int dpos)
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.
protected static boolean matchArray(int[] r,
int rpos,
int rend,
char[] d,
int dpos)
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.d - The array of char that should start from a part of r.dpos - The starting offset in d for the matching.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||