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, useReferenceFilterinstead.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 booleanequals(Object other)Deprecated.StringgetRegex()Deprecated.inthashCode()Deprecated.booleanisCaseSensitive()Deprecated.protected booleanisDocumentMatched(HandlerDoc doc, InputStream input, ParseState parseState)Deprecated.protected voidloadFilterFromXML(XML xml)Deprecated.protected voidsaveFilterToXML(XML xml)Deprecated.voidsetCaseSensitive(boolean caseSensitive)Deprecated.voidsetRegex(String regex)Deprecated.StringtoString()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:
isDocumentMatchedin classAbstractDocumentFilter- Throws:
ImporterHandlerException
-
loadFilterFromXML
protected void loadFilterFromXML(XML xml)
Deprecated.- Specified by:
loadFilterFromXMLin classAbstractDocumentFilter
-
saveFilterToXML
protected void saveFilterToXML(XML xml)
Deprecated.- Specified by:
saveFilterToXMLin classAbstractDocumentFilter
-
equals
public boolean equals(Object other)
Deprecated.- Overrides:
equalsin classAbstractDocumentFilter
-
hashCode
public int hashCode()
Deprecated.- Overrides:
hashCodein classAbstractDocumentFilter
-
toString
public String toString()
Deprecated.- Overrides:
toStringin classAbstractDocumentFilter
-
-