|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.wikimodel.wem.impl.WikiScannerUtil
public class WikiScannerUtil
This class contains some utility methods used by scanners.
| Constructor Summary | |
|---|---|
WikiScannerUtil()
|
|
| Method Summary | |
|---|---|
static String |
extractSubstring(String str,
String open,
String close,
char escape)
Extracts and returns a substring of the given string starting from the given open sequence and finishing by the specified close sequence. |
static int |
getNextSequence(char[] array,
int pos,
char[] delimiter,
StringBuffer buf)
This method copies to the given buffer all characters from the specified position of the character array to the next delimiter position. |
static int |
getNextToken(char[] array,
int pos,
StringBuffer buf)
|
static int |
removeSpaces(char[] array,
int pos,
StringBuffer buf)
Moves forward the current position in the array until the first not empty character is found. |
static int |
skipSequence(char[] array,
int arrayPos,
char[] sequence)
Skips the specified sequence if it starts from the given position in the character array. |
static void |
splitToPairs(String str,
List<WikiParameter> list)
Splits the given string into a set of key-value pairs; all extracted values will be added to the given list |
static void |
splitToPairs(String str,
List<WikiParameter> list,
String delimiter)
Splits the given string into a set of key-value pairs; all extracted values will be added to the given list |
static String |
unescape(String str,
char escape)
Unescapes the given string and returns the result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WikiScannerUtil()
| Method Detail |
|---|
public static String extractSubstring(String str,
String open,
String close,
char escape)
str - from this string the substring framed by the specified open
and close sequence will be returnedopen - the start substring sequenceclose - the closing substring sequenceescape - the escape symbol
public static int getNextSequence(char[] array,
int pos,
char[] delimiter,
StringBuffer buf)
array - the array of character used as a source of charspos - the start position in the arraydelimiter - the delimiter; this method copies all character from the
current position to the first delimiter sequencebuf - the buffer where the content should be appended
public static int getNextToken(char[] array,
int pos,
StringBuffer buf)
array - from this array of bytes the next token will be returnedpos - the current position in the array of bytesbuf - to this buffer the extracted token value will be appended
public static int removeSpaces(char[] array,
int pos,
StringBuffer buf)
array - the array of characters where the spaces are searchedpos - the current position in the array; starting from this position
the spaces will be searchedbuf - to this buffer all not empty characters will be added
public static int skipSequence(char[] array,
int arrayPos,
char[] sequence)
array - the array of charactersarrayPos - the position of the first character in the array;
starting from this position the sequence should be skippedsequence - the sequence of characters to skip
public static void splitToPairs(String str,
List<WikiParameter> list)
str - the string to splitlist - to this list all extracted values will be added
public static void splitToPairs(String str,
List<WikiParameter> list,
String delimiter)
str - the string to splitlist - to this list all extracted values will be addeddelimiter - a delimiter for individual key/value pairs
public static String unescape(String str,
char escape)
str - the string to unescapeescape - the symbol used to escape characters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||