Class HTMLStripCharFilter
- java.lang.Object
-
- java.io.Reader
-
- org.apache.lucene.analysis.CharFilter
-
- org.apache.lucene.analysis.charfilter.BaseCharFilter
-
- org.apache.lucene.analysis.charfilter.HTMLStripCharFilter
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Readable
public final class HTMLStripCharFilter extends BaseCharFilter
A CharFilter that wraps another Reader and attempts to strip out HTML constructs.
-
-
Constructor Summary
Constructors Constructor Description HTMLStripCharFilter(java.io.Reader source)Creates a new HTMLStripCharFilter over the provided Reader.HTMLStripCharFilter(java.io.Reader source, java.util.Set<java.lang.String> escapedTags)Creates a new HTMLStripCharFilter over the provided Reader with the specified start and end tags.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the underlying input stream.intread()intread(char[] cbuf, int off, int len)-
Methods inherited from class org.apache.lucene.analysis.CharFilter
correctOffset
-
-
-
-
Constructor Detail
-
HTMLStripCharFilter
public HTMLStripCharFilter(java.io.Reader source)
Creates a new HTMLStripCharFilter over the provided Reader.- Parameters:
source- Reader to strip html tags from.
-
HTMLStripCharFilter
public HTMLStripCharFilter(java.io.Reader source, java.util.Set<java.lang.String> escapedTags)Creates a new HTMLStripCharFilter over the provided Reader with the specified start and end tags.- Parameters:
source- Reader to strip html tags from.escapedTags- Tags in this set (both start and end tags) will not be filtered out.
-
-
Method Detail
-
read
public int read() throws java.io.IOException- Overrides:
readin classjava.io.Reader- Throws:
java.io.IOException
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException- Specified by:
readin classjava.io.Reader- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionDescription copied from class:CharFilterCloses the underlying input stream.NOTE: The default implementation closes the input Reader, so be sure to call
super.close()when overriding this method.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classCharFilter- Throws:
java.io.IOException
-
-