@Override public void init(Map<String, String> args) { super.init( args ); p = getPattern("pattern"); replacement = args.get( "replacement" ); if( replacement == null ) replacement = ""; // TODO: warn if you set maxBlockChars or blockDelimiters ? maxBlockChars = getInt( "maxBlockChars", PatternReplaceCharFilter.DEFAULT_MAX_BLOCK_CHARS ); blockDelimiters = args.get( "blockDelimiters" ); }
@Override public Reader create(Reader tokenStream) { return new PatternReplaceCharFilter(pattern, replacement, tokenStream); }
@Override public CharFilter create(Reader input) { return new PatternReplaceCharFilter( p, replacement, maxBlockChars, blockDelimiters, input ); }