Class ConditionalDocHandler
java.lang.Object
com.norconex.importer.handler.condition.ConditionalDocHandler
- All Implemented Interfaces:
DocHandler,Labelable
Conditionally execute one or more doc handlers (possibly including other
conditional doc handlers) upon matching a condition, or not. Conditional
handlers effectively allows you to perform if/then/else using objects,
facilitating basic decision branches in Importer flow configuration.
-
Field Summary
Fields inherited from interface com.norconex.importer.handler.DocHandler
NAME -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConditionalDocHandler(boolean negated) protectedConditionalDocHandler(Condition condition, boolean negated) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleangetLabel()Gets an optional user-supplied label.abstract StringgetName()booleanhandle(@NonNull DocHandlerContext docHandlerContext) Perform any operations on a document.inthashCode()booleanvoidsetCondition(Condition condition) setElseHandlers(List<DocHandler> elseHandlers) voidsetThenHandlers(List<DocHandler> thenHandlers) toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.norconex.importer.handler.DocHandler
close, init
-
Constructor Details
-
ConditionalDocHandler
protected ConditionalDocHandler(boolean negated) -
ConditionalDocHandler
-
-
Method Details
-
getName
-
getThenHandlers
-
setThenHandlers
-
getElseHandlers
-
setElseHandlers
-
handle
Description copied from interface:DocHandlerPerform any operations on a document.- Specified by:
handlein interfaceDocHandler- Parameters:
docHandlerContext- the document handling context- Returns:
falseto stop processing and reject a document ortrueto proceed to the next configured handler.- Throws:
IOException- An I/O exception of some sort has occurred
-
getLabel
Description copied from interface:LabelableGets an optional user-supplied label. -
isNegated
public boolean isNegated() -
getCondition
-
setLabel
-
setCondition
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-