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, useTextFilterinstead.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 booleanequals(Object other)Deprecated.StringgetField()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.voidsetField(String property)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
-
-
-
-
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:
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
-
-