Class AbstractParseFilter
-
- All Implemented Interfaces:
-
ai.platon.pulsar.common.config.Parameterized,ai.platon.pulsar.skeleton.crawl.parse.ParseFilter,java.lang.AutoCloseable
public abstract class AbstractParseFilter implements ParseFilter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classAbstractParseFilter.Companion
-
Field Summary
Fields Modifier and Type Field Description private final List<ParseFilter>childrenprivate final Integeridprivate ParseFilterparentprivate final IntegerparentIdprivate final BooleanisRootprivate final BooleanisLeafpublic final static AbstractParseFilter.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description AbstractParseFilter(Integer id, ParseFilter parent)
-
Method Summary
Modifier and Type Method Description List<ParseFilter>getChildren()The child filters final IntegergetId()ParseFiltergetParent()The parent filter UnitsetParent(ParseFilter parent)The parent filter Unitinitialize()Initialize the filter. CheckStateisRelevant(ParseContext parseContext)Check if this parse filter is relevant to this page. FilterResultfilter(ParseContext parseContext)Do the filtering. UnitonBeforeFilter(ParseContext parseContext)Invoke before the filtering. UnitonAfterFilter(ParseContext parseContext)Invoke after the filtering. UnitaddFirst(ParseFilter child)Add the filter to the head of the child filter list. UnitaddLast(ParseFilter child)Add the filter to the tail of the child filter list. Unitclose()Close the filter. -
Methods inherited from class ai.platon.pulsar.skeleton.crawl.parse.ParseFilter
getParentId, isLeaf, isRoot -
Methods inherited from class ai.platon.pulsar.common.config.Parameterized
getParams -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
AbstractParseFilter
AbstractParseFilter(Integer id, ParseFilter parent)
-
-
Method Detail
-
getChildren
List<ParseFilter> getChildren()
The child filters
-
getParent
ParseFilter getParent()
The parent filter
-
setParent
Unit setParent(ParseFilter parent)
The parent filter
-
initialize
Unit initialize()
Initialize the filter.
-
isRelevant
CheckState isRelevant(ParseContext parseContext)
Check if this parse filter is relevant to this page. Sometimes we may want to write a separate ParseFilter for a category.
-
filter
FilterResult filter(ParseContext parseContext)
Do the filtering.
-
onBeforeFilter
Unit onBeforeFilter(ParseContext parseContext)
Invoke before the filtering.
-
onAfterFilter
Unit onAfterFilter(ParseContext parseContext)
Invoke after the filtering.
-
addFirst
Unit addFirst(ParseFilter child)
Add the filter to the head of the child filter list.
-
addLast
Unit addLast(ParseFilter child)
Add the filter to the tail of the child filter list.
-
-
-
-