Class WebPageHTMLDocumentEventHandler
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.lang.ChainedHandler,ai.platon.pulsar.common.lang.PFunction,ai.platon.pulsar.common.lang.PFunction2,ai.platon.pulsar.common.lang.PHandler
public class WebPageHTMLDocumentEventHandler extends AbstractChainedFunction2<WebPage, FeaturedDocument, Any>
An event handler that accepts a WebPage and a FeaturedDocument, anything can be returned.
The event handler should work with the passed document, such as extracting fields, persisting extraction results, collecting more links, and so on.
The Web asset might be changed by the handler since WebPage has setters.
Another possible way to write more robust code is to remove all setters in WebPage, and add a MutableWebPage subclass.
-
-
Field Summary
Fields Modifier and Type Field Description private final BooleanisEmptyprivate final BooleanisNotEmptyprivate final BooleanisRelevantprivate final Stringnameprivate final Integerpriorityprivate final Integersize
-
Constructor Summary
Constructors Constructor Description WebPageHTMLDocumentEventHandler()
-
Method Summary
Modifier and Type Method Description Objectinvoke(WebPage page, FeaturedDocument document)-
Methods inherited from class ai.platon.pulsar.common.lang.ChainedHandler
isEmpty, isNotEmpty -
Methods inherited from class ai.platon.pulsar.common.lang.AbstractPFunction
getName, getPriority, isRelevant -
Methods inherited from class ai.platon.pulsar.common.lang.AbstractChainedFunction2
addFirst, addFirst, addLast, addLast, clear, getSize, remove -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
invoke
Object invoke(WebPage page, FeaturedDocument document)
-
-
-
-