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 void
close()
Closes the underlying input stream.int
read()
int
read(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:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
read
public int read(char[] cbuf, int off, int len) throws java.io.IOException
- Specified by:
read
in classjava.io.Reader
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
Description copied from class:CharFilter
Closes 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classCharFilter
- Throws:
java.io.IOException
-
-