org.txt2xml.core
Class RegexMatchProcessor
java.lang.Object
|
+--org.txt2xml.core.Processor
|
+--org.txt2xml.core.AbstractRegexProcessor
|
+--org.txt2xml.core.RegexMatchProcessor
- public class RegexMatchProcessor
- extends AbstractRegexProcessor
Matches sections of text specified by groups in a
regex pattern. For example when
regex='\s*(\d),\s*(\d)' this Processor will
operate against " 1, 2" with the matches: "1", "2".
This Processor does not repeat, so in the above case,]
it will operate against "1, 2, 3" with "1", "2" and pass on the
remainder ", 3" to a subsequent Processor if any.
- Author:
- Steve Meyfroidt
|
Method Summary |
protected boolean |
findMatch()
Find next match, updating state appropriately. |
protected java.lang.CharSequence |
getMatchedText()
Override this! |
protected java.lang.CharSequence |
getRemainderText()
Override this! |
protected void |
resetMatching()
Matches against the regex to find all matched groups
that will be stepped through in findMatch(). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexMatchProcessor
public RegexMatchProcessor()
findMatch
protected boolean findMatch()
- Description copied from class:
Processor
- Find next match, updating state appropriately. Override this!
- Specified by:
findMatch in class Processor
- Returns:
- true if got a match, else false.
getMatchedText
protected java.lang.CharSequence getMatchedText()
- Description copied from class:
Processor
- Override this!
- Specified by:
getMatchedText in class Processor
- Returns:
- CharSequence for text matched in last
Processor.findMatch().
getRemainderText
protected java.lang.CharSequence getRemainderText()
- Description copied from class:
Processor
- Override this!
- Specified by:
getRemainderText in class Processor
- Returns:
- CharSequence for remainder of text after last match.
resetMatching
protected void resetMatching()
- Matches against the regex to find all matched groups
that will be stepped through in
findMatch().
- Overrides:
resetMatching in class AbstractRegexProcessor
Copyright © 2002 Steve Meyfroidt. All Rights Reserved.