Class RegexMetadataFilter
- java.lang.Object
-
- com.norconex.importer.handler.AbstractImporterHandler
-
- com.norconex.importer.handler.filter.AbstractDocumentFilter
-
- com.norconex.importer.handler.filter.impl.RegexMetadataFilter
-
- All Implemented Interfaces:
IXMLConfigurable
,IDocumentFilter
,IOnMatchFilter
,IImporterHandler
@Deprecated public class RegexMetadataFilter extends AbstractDocumentFilter
Deprecated.Since 3.0.0, useTextFilter
instead.Accepts or rejects a document based on its field values using regular expression.
XML configuration usage:
<handler class="com.norconex.importer.handler.filter.impl.RegexMetadataFilter" onMatch="[include|exclude]" caseSensitive="[false|true]" field="(name of metadata name to match)" > <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 value to match)</regex> </handler>
Usage example:
This example will accept only documents containing word "potato" in the title.
<handler class="RegexMetadataFilter" onMatch="include" field="title" > <regex>.*potato.*</regex> </handler>
- Author:
- Pascal Essiembre
-
-
Constructor Summary
Constructors Constructor Description RegexMetadataFilter()
Deprecated.RegexMetadataFilter(String field, String regex)
Deprecated.RegexMetadataFilter(String field, String regex, OnMatch onMatch)
Deprecated.RegexMetadataFilter(String property, 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
getField()
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
setField(String property)
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
-
-
-
-
Method Detail
-
getRegex
public String getRegex()
Deprecated.
-
setRegex
public final void setRegex(String regex)
Deprecated.
-
isCaseSensitive
public boolean isCaseSensitive()
Deprecated.
-
getField
public String getField()
Deprecated.
-
setCaseSensitive
public void setCaseSensitive(boolean caseSensitive)
Deprecated.
-
setField
public void setField(String property)
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
-
-