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:
Closeable,AutoCloseable,Readable
A CharFilter that wraps another Reader and attempts to strip out HTML constructs.
-
Constructor Summary
ConstructorsConstructorDescriptionHTMLStripCharFilter(Reader source) Creates a new HTMLStripCharFilter over the provided Reader.HTMLStripCharFilter(Reader source, Set<String> escapedTags) Creates a new HTMLStripCharFilter over the provided Reader with the specified start and end tags. -
Method Summary
Methods inherited from class org.apache.lucene.analysis.CharFilter
correctOffsetMethods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, ready, reset, skip, transferTo
-
Constructor Details
-
HTMLStripCharFilter
Creates a new HTMLStripCharFilter over the provided Reader.- Parameters:
source- Reader to strip html tags from.
-
HTMLStripCharFilter
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 Details
-
read
- Overrides:
readin classReader- Throws:
IOException
-
read
- Specified by:
readin classReader- Throws:
IOException
-
close
Description 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 interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classCharFilter- Throws:
IOException
-