org.txt2xml.core
Class RegexDelimitedProcessor
java.lang.Object
|
+--org.txt2xml.core.Processor
|
+--org.txt2xml.core.AbstractRegexProcessor
|
+--org.txt2xml.core.RegexDelimitedProcessor
- public class RegexDelimitedProcessor
- extends AbstractRegexProcessor
Repeatedly matches sections of text delimited
by a regex pattern. For example, when
regex=',' this Processor will operate against "1,2,3" with the
following matches: "1", "2", "3".
- Author:
- Steve Meyfroidt
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
matchStart
protected int matchStart
matchEnd
protected int matchEnd
nextMatchFrom
protected int nextMatchFrom
RegexDelimitedProcessor
public RegexDelimitedProcessor()
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:
- null because this repeating Processor
completely consumes the text.
resetMatching
protected void resetMatching()
- Description copied from class:
Processor
- Called at start of
Processor.generateXmlFragment(CharSequence, ContentHandler)
to reset the state before starting a round of matching. Override to
prepare for a round of matching, eg RegexDelimitedProcessor
resets the regex Matcher here.
- Overrides:
resetMatching
in class AbstractRegexProcessor
Copyright © 2002 Steve Meyfroidt. All Rights Reserved.