org.txt2xml.core
Class AbstractRegexProcessor

java.lang.Object
  |
  +--org.txt2xml.core.Processor
        |
        +--org.txt2xml.core.AbstractRegexProcessor
Direct Known Subclasses:
RegexDelimitedProcessor, RegexMatchProcessor

public abstract class AbstractRegexProcessor
extends Processor

Base class for regex based Processors that can accept a pattern String and need to create a java.util.regex.Matcher before processing text.

Author:
Steve Meyfroidt

Field Summary
protected  java.util.regex.Matcher matcher
           
protected  java.util.regex.Pattern pattern
           
protected  java.lang.String regex
           
 
Fields inherited from class org.txt2xml.core.Processor
chars, handler, NULL_ATTRIBUTES, parent
 
Constructor Summary
AbstractRegexProcessor()
           
 
Method Summary
 java.lang.String getRegex()
           
protected  void resetMatching()
          Called at start of Processor.generateXmlFragment(CharSequence, ContentHandler) to reset the state before starting a round of matching.
 void setRegex(java.lang.String regex)
           
 
Methods inherited from class org.txt2xml.core.Processor
findMatch, generateEndXmlElement, generateStartXmlElement, generateXmlElementCharacters, generateXmlFragment, getElement, getMatchedText, getNextProcessor, getRemainderText, getSubProcessor, setElement, setNextProcessor, setSubProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

regex

protected java.lang.String regex

pattern

protected java.util.regex.Pattern pattern

matcher

protected java.util.regex.Matcher matcher
Constructor Detail

AbstractRegexProcessor

public AbstractRegexProcessor()
Method Detail

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 Processor

getRegex

public java.lang.String getRegex()

setRegex

public void setRegex(java.lang.String regex)


Copyright 2002 Steve Meyfroidt. All Rights Reserved.