| java.lang.Object org.mmbase.util.transformers.ReaderTransformer org.mmbase.util.transformers.ConfigurableReaderTransformer org.mmbase.util.transformers.ChunkedTransformer org.mmbase.util.transformers.RegexpReplacer
All known Subclasses: org.mmbase.util.transformers.LinkFinder, org.mmbase.util.transformers.Censor,
RegexpReplacer | public class RegexpReplacer extends ChunkedTransformer (Code) | | Finds regexps in the Character String, and replaces them. The replaced regexps can be found in a configuration file 'regexps.xml' (if it is present).
It ignores existing XML markup, and also avoids trailing dots and comments and surrounding quotes and parentheses.
author: Michiel Meeuwissen since: MMBase-1.8 |
Inner Class :abstract protected static class PatternWatcher extends ResourceWatcher | |
RegexpReplacer | public RegexpReplacer(int i)(Code) | | |
RegexpReplacer | public RegexpReplacer()(Code) | | |
addPatterns | protected static void addPatterns(Collection> list, Collection<Entry<Pattern, String>> patterns)(Code) | | Utility function to create a bunch of patterns.
Parameters: list - A Collection of Map.Entry (like java.util.Map.entrySet), containingpairs of Strings Parameters: patterns - This the Collection of Entries. The key of every entry is a compiled regularexpression. The value is still a String. New entries will be added to this collectionby this function. |
getConfigFile | protected String getConfigFile()(Code) | | This can be overridden if the implementation must use its own configuration file.
|
getPatterns | protected Collection<Entry<Pattern, String>> getPatterns()(Code) | | This on default gives the regexps configured for the base-class (a static member). You can
override this method to return another Collection.
|
readDefaultPatterns | protected void readDefaultPatterns(Collection<Entry<Pattern, String>> patterns)(Code) | | Reads defaults translation patterns into the given collection patterns. Override this for
other default patterns.
|
Methods inherited from org.mmbase.util.transformers.ChunkedTransformer | abstract protected String base()(Code)(Java Doc) public void configure(int i)(Code)(Java Doc) public String getEncoding()(Code)(Java Doc) public static void main(String[] argv)(Code)(Java Doc) protected Status newStatus()(Code)(Java Doc) abstract protected boolean replace(String string, Writer w, Status status) throws IOException(Code)(Java Doc) protected boolean replace(Status status)(Code)(Java Doc) protected boolean replaceWord(StringBuilder word, Writer writer, Status status) throws IOException(Code)(Java Doc) public Writer transform(Reader r, Writer w)(Code)(Java Doc) public Writer transformEntire(Reader r, Writer w)(Code)(Java Doc) public Writer transformLines(Reader r, Writer w)(Code)(Java Doc) public Writer transformWords(Reader r, Writer w)(Code)(Java Doc) public Writer transformXmlText(Reader r, Writer w)(Code)(Java Doc) public Writer transformXmlTextWords(Reader r, Writer w)(Code)(Java Doc) public Map<String, Config> transformers()(Code)(Java Doc)
|
Fields inherited from org.mmbase.util.transformers.ConfigurableReaderTransformer | protected int to(Code)(Java Doc)
|
|
|