public class RegexMetadataFilter extends AbstractOnMatchFilter implements IDocumentFilter, IXMLConfigurable
XML configuration usage:
<filter class="com.norconex.importer.filter.impl.RegexMetadataFilter" onMatch="[include|exclude]" caseSensitive="[false|true]" property="(name of metadata name to match)" > (regular expression of value to match) </filter>
Constructor and Description |
---|
RegexMetadataFilter() |
RegexMetadataFilter(String property,
String regex) |
RegexMetadataFilter(String property,
String regex,
OnMatch onMatch) |
RegexMetadataFilter(String property,
String regex,
OnMatch onMatch,
boolean caseSensitive) |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptDocument(InputStream document,
Properties metadata,
boolean parsed)
Whether to accepts a document.
|
boolean |
equals(Object obj) |
String |
getProperty() |
String |
getRegex() |
int |
hashCode() |
boolean |
isCaseSensitive() |
void |
loadFromXML(Reader in) |
void |
saveToXML(Writer out) |
void |
setCaseSensitive(boolean caseSensitive) |
void |
setProperty(String property) |
void |
setRegex(String regex) |
String |
toString() |
getOnMatch, loadFromXML, saveToXML, setOnMatch
public String getRegex()
public boolean isCaseSensitive()
public String getProperty()
public void setCaseSensitive(boolean caseSensitive)
public void setProperty(String property)
public final void setRegex(String regex)
public final boolean acceptDocument(InputStream document, Properties metadata, boolean parsed) throws IOException
IDocumentFilter
acceptDocument
in interface IDocumentFilter
document
- the document to evaluatemetadata
- document metadataparsed
- whether the document has been parsed already or not (a
parsed document should normally be text-based)true
if document is acceptedIOException
- problem reading the documentpublic void loadFromXML(Reader in)
loadFromXML
in interface IXMLConfigurable
public void saveToXML(Writer out) throws IOException
saveToXML
in interface IXMLConfigurable
IOException
public String toString()
toString
in class AbstractOnMatchFilter
public int hashCode()
hashCode
in class AbstractOnMatchFilter
public boolean equals(Object obj)
equals
in class AbstractOnMatchFilter
Copyright © 2009-2014 Norconex Inc.. All Rights Reserved.