Package org.revapi.base
Class IndependentTreeFilter<E extends Element<E>>
- java.lang.Object
-
- org.revapi.base.BaseTreeFilter<E>
-
- org.revapi.base.IndependentTreeFilter<E>
-
- All Implemented Interfaces:
TreeFilter<E>
public abstract class IndependentTreeFilter<E extends Element<E>> extends BaseTreeFilter<E>
A simple implementation of theTreeFilter
interface that simply repeats the result provided from thestart(Element)
method in itsfinish(Element)
method.This is what filters that do not depend on any other element usually need.
-
-
Constructor Summary
Constructors Constructor Description IndependentTreeFilter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract FilterStartResult
doStart(E element)
FilterFinishResult
finish(E element)
This method is called after the filtering hasstarted
and all children have been processed by this filter.FilterStartResult
start(E element)
This method is called when an element is about to be filtered.-
Methods inherited from class org.revapi.base.BaseTreeFilter
finish
-
-
-
-
Method Detail
-
start
public final FilterStartResult start(E element)
Description copied from interface:TreeFilter
This method is called when an element is about to be filtered. After this call all the children will be processed (if the result instructs the caller to do so). Only after that, theTreeFilter.finish(Element)
will be called with the same element as this method.- Specified by:
start
in interfaceTreeFilter<E extends Element<E>>
- Overrides:
start
in classBaseTreeFilter<E extends Element<E>>
- Parameters:
element
- the element to start filtering- Returns:
- a filter result informing the caller what was the result of filtering and whether to descend to children or not
-
doStart
protected abstract FilterStartResult doStart(E element)
-
finish
public FilterFinishResult finish(E element)
Description copied from interface:TreeFilter
This method is called after the filtering hasstarted
and all children have been processed by this filter.Note that the result can still be
Ternary.UNDECIDED
. It is expected that such elements will in the end be resolved with theTreeFilter.finish()
method.- Specified by:
finish
in interfaceTreeFilter<E extends Element<E>>
- Overrides:
finish
in classBaseTreeFilter<E extends Element<E>>
- Parameters:
element
- the element for which the filtering has finished- Returns:
- the result of filtering
-
-