public class RegexpReplacer extends ChunkedTransformer<Pattern>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
RegexpReplacer.PatternWatcher |
ChunkedTransformer.Status| Modifier and Type | Field and Description |
|---|---|
protected static Collection<Entry<Pattern,String>> |
regexps
The regexps for the unextended RegexpReplacer
|
protected boolean |
replaceInA |
ENTIRE, LINES, ONLY_REPLACE_FIRST_MATCH, ONLY_USE_FIRST_MATCHING_PATTERN, onlyFirstMatch, onlyFirstPattern, WORDS, XMLTEXT, XMLTEXT_WORDSto| Constructor and Description |
|---|
RegexpReplacer() |
RegexpReplacer(int i) |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
addPatterns(Collection<Map.Entry<String,String>> list,
Collection<Entry<Pattern,String>> patterns)
Utility function to create a bunch of patterns.
|
protected String |
base() |
protected String |
getConfigFile()
This can be overridden if the implementation must use its own configuration file.
|
protected Collection<Entry<Pattern,String>> |
getPatterns()
This on default gives the regexps configured for the base-class (a static member).
|
static void |
main(String[] arg) |
protected void |
readDefaultPatterns(Collection<Entry<Pattern,String>> patterns)
Reads defaults translation patterns into the given collection patterns.
|
protected void |
readPatterns(Collection<Entry<Pattern,String>> patterns)
Reads patterns from config-file into given Collection
|
protected boolean |
replace(String string,
Writer w,
ChunkedTransformer.Status status)
Implement this.
|
String |
toString() |
configure, getEncoding, newStatus, replace, replaceWord, transform, transformEntire, transformers, transformLines, transformWords, transformXmlText, transformXmlTextWordstransform, transform, transformBack, transformBack, transformBackclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waittransform, transform, transformBack, transformBack, transformBackprotected static final Collection<Entry<Pattern,String>> regexps
protected boolean replaceInA
public RegexpReplacer(int i)
public RegexpReplacer()
protected Collection<Entry<Pattern,String>> getPatterns()
protected String getConfigFile()
protected void readDefaultPatterns(Collection<Entry<Pattern,String>> patterns)
protected final void readPatterns(Collection<Entry<Pattern,String>> patterns)
protected static void addPatterns(Collection<Map.Entry<String,String>> list, Collection<Entry<Pattern,String>> patterns)
list - A Collection of Map.Entry (like Map.entrySet()), containing
pairs of Stringspatterns - This the Collection of Entries. The key of every entry is a compiled regular
expression. The value is still a String. New entries will be added to this collection
by this function.protected boolean replace(String string, Writer w, ChunkedTransformer.Status status) throws IOException
ChunkedTransformerreplace in class ChunkedTransformer<Pattern>IOExceptionprotected final String base()
base in class ChunkedTransformer<Pattern>public String toString()
toString in interface TransformertoString in class ConfigurableReaderTransformerpublic static void main(String[] arg)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}