ReferenceFilter
instead.@Deprecated public class RegexReferenceFilter extends AbstractDocumentFilter
Accepts or rejects a document based on its reference (e.g. URL).
<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.
The following will reject documents having "/login/" in their reference.
<handler class="RegexReferenceFilter" onMatch="exclude"> <regex>.*/login/.*</regex> </handler>
Constructor and Description |
---|
RegexReferenceFilter()
Deprecated.
|
RegexReferenceFilter(String regex)
Deprecated.
|
RegexReferenceFilter(String regex,
OnMatch onMatch)
Deprecated.
|
RegexReferenceFilter(String regex,
OnMatch onMatch,
boolean caseSensitive)
Deprecated.
|
Modifier and Type | Method and 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.
|
acceptDocument, getOnMatch, loadHandlerFromXML, saveHandlerToXML, setOnMatch
addRestriction, addRestriction, addRestrictions, clearRestrictions, detectCharsetIfBlank, getRestrictions, isApplicable, loadFromXML, removeRestriction, removeRestriction, saveToXML
public RegexReferenceFilter()
public RegexReferenceFilter(String regex)
public String getRegex()
public boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
public final void setRegex(String regex)
protected boolean isDocumentMatched(HandlerDoc doc, InputStream input, ParseState parseState) throws ImporterHandlerException
isDocumentMatched
in class AbstractDocumentFilter
ImporterHandlerException
protected void loadFilterFromXML(XML xml)
loadFilterFromXML
in class AbstractDocumentFilter
protected void saveFilterToXML(XML xml)
saveFilterToXML
in class AbstractDocumentFilter
public boolean equals(Object other)
equals
in class AbstractDocumentFilter
public int hashCode()
hashCode
in class AbstractDocumentFilter
public String toString()
toString
in class AbstractDocumentFilter
Copyright © 2009–2023 Norconex Inc.. All rights reserved.