Class RegexReferenceFilter
- java.lang.Object
-
- com.norconex.importer.handler.AbstractImporterHandler
-
- com.norconex.importer.handler.filter.AbstractDocumentFilter
-
- com.norconex.importer.handler.filter.impl.RegexReferenceFilter
-
- All Implemented Interfaces:
IXMLConfigurable
,IDocumentFilter
,IOnMatchFilter
,IImporterHandler
@Deprecated public class RegexReferenceFilter extends AbstractDocumentFilter
Deprecated.Since 3.0.0, useReferenceFilter
instead.Accepts or rejects a document based on its reference (e.g. URL).
XML configuration usage:
<handler class="com.norconex.importer.handler.filter.impl.RegexReferenceFilter" onMatch="[include|exclude]" caseSensitive="[false|true]"> <restrictTo caseSensitive="[false|true]" field="(name of header/metadata field name to match)"> (regular expression of value to match) </restrictTo> <!-- multiple "restrictTo" tags allowed (only one needs to match) --> <regex>(regular expression of reference to match)</regex> </handler>
Can be used both as a pre-parse or post-parse handler.
Usage example:
The following will reject documents having "/login/" in their reference.
<handler class="RegexReferenceFilter" onMatch="exclude"> <regex>.*/login/.*</regex> </handler>
- Since:
- 2.7.0
- Author:
- Pascal Essiembre
-
-
Constructor Summary
Constructors Constructor Description RegexReferenceFilter()
Deprecated.RegexReferenceFilter(String regex)
Deprecated.RegexReferenceFilter(String regex, OnMatch onMatch)
Deprecated.RegexReferenceFilter(String regex, OnMatch onMatch, boolean caseSensitive)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
equals(Object other)
Deprecated.String
getRegex()
Deprecated.int
hashCode()
Deprecated.boolean
isCaseSensitive()
Deprecated.protected boolean
isDocumentMatched(HandlerDoc doc, InputStream input, ParseState parseState)
Deprecated.protected void
loadFilterFromXML(XML xml)
Deprecated.protected void
saveFilterToXML(XML xml)
Deprecated.void
setCaseSensitive(boolean caseSensitive)
Deprecated.void
setRegex(String regex)
Deprecated.String
toString()
Deprecated.-
Methods inherited from class com.norconex.importer.handler.filter.AbstractDocumentFilter
acceptDocument, getOnMatch, loadHandlerFromXML, saveHandlerToXML, setOnMatch
-
Methods inherited from class com.norconex.importer.handler.AbstractImporterHandler
addRestriction, addRestriction, addRestrictions, clearRestrictions, detectCharsetIfBlank, getRestrictions, isApplicable, loadFromXML, removeRestriction, removeRestriction, saveToXML
-
-
-
-
Constructor Detail
-
RegexReferenceFilter
public RegexReferenceFilter()
Deprecated.
-
RegexReferenceFilter
public RegexReferenceFilter(String regex)
Deprecated.
-
-
Method Detail
-
getRegex
public String getRegex()
Deprecated.
-
isCaseSensitive
public boolean isCaseSensitive()
Deprecated.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
Deprecated.
-
setRegex
public final void setRegex(String regex)
Deprecated.
-
isDocumentMatched
protected boolean isDocumentMatched(HandlerDoc doc, InputStream input, ParseState parseState) throws ImporterHandlerException
Deprecated.- Specified by:
isDocumentMatched
in classAbstractDocumentFilter
- Throws:
ImporterHandlerException
-
loadFilterFromXML
protected void loadFilterFromXML(XML xml)
Deprecated.- Specified by:
loadFilterFromXML
in classAbstractDocumentFilter
-
saveFilterToXML
protected void saveFilterToXML(XML xml)
Deprecated.- Specified by:
saveFilterToXML
in classAbstractDocumentFilter
-
equals
public boolean equals(Object other)
Deprecated.- Overrides:
equals
in classAbstractDocumentFilter
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCode
in classAbstractDocumentFilter
-
toString
public String toString()
Deprecated.- Overrides:
toString
in classAbstractDocumentFilter
-
-