public class PatternReplaceCharFilter extends BaseCharFilter
ex1) source="aa bb aa bb", pattern="(aa)\\s+(bb)" replacement="$1#$2"
output="aa#bb aa#bb"
ex2) source="aa123bb", pattern="(aa)\\d+(bb)" replacement="$1 $2"
output="aa bb"
and you want to search bb and highlight it, you will get
highlight snippet="aa1<em>23bb</em>"
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MAX_BLOCK_CHARS
Deprecated.
|
input
Constructor and Description |
---|
PatternReplaceCharFilter(Pattern pattern,
String replacement,
int maxBlockChars,
String blockDelimiter,
Reader in)
Deprecated.
|
PatternReplaceCharFilter(Pattern pattern,
String replacement,
Reader in) |
Modifier and Type | Method and Description |
---|---|
protected int |
correct(int currentOff)
Retrieve the corrected offset.
|
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
addOffCorrectMap, getLastCumulativeDiff
close, correctOffset
@Deprecated public static final int DEFAULT_MAX_BLOCK_CHARS
public PatternReplaceCharFilter(Pattern pattern, String replacement, Reader in)
@Deprecated public PatternReplaceCharFilter(Pattern pattern, String replacement, int maxBlockChars, String blockDelimiter, Reader in)
public int read(char[] cbuf, int off, int len) throws IOException
read
in class Reader
IOException
public int read() throws IOException
read
in class Reader
IOException
protected int correct(int currentOff)
BaseCharFilter
correct
in class BaseCharFilter
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.