public final class SourceSectionFilter extends Object
Start building event filters by calling SourceSectionFilter.newBuilder()
and complete
them by calling SourceSectionFilter.Builder.build()
.
Modifier and Type | Class and Description |
---|---|
class |
SourceSectionFilter.Builder
Configure your own
SourceSectionFilter before creating its instance. |
static class |
SourceSectionFilter.IndexRange
Represents a range between two indices within a
source section
filter . |
static interface |
SourceSectionFilter.SourcePredicate
Represents a predicate for source objects.
|
Modifier and Type | Field and Description |
---|---|
static SourceSectionFilter |
ANY
A filter that matches everything.
|
Modifier and Type | Method and Description |
---|---|
boolean |
includes(Node node)
Checks if the filter includes the given node, i.e.
|
boolean |
includes(RootNode rootNode,
SourceSection nodeSourceSection,
Set<Class<?>> originalTags)
Checks if the filter includes the given root node, i.e.
|
static SourceSectionFilter.Builder |
newBuilder()
Creates a new
SourceSectionFilter expression using a builder pattern. |
String |
toString() |
public static final SourceSectionFilter ANY
public static SourceSectionFilter.Builder newBuilder()
SourceSectionFilter
expression using a builder
pattern.
Individual builder statements are interpreted as conjunctions (AND) while multiple parameters
for individual filter expressions are treated as disjunctions (OR). To create the final
filter finalize the expression using SourceSectionFilter.Builder.build()
.SourceSectionFilter
instancesSourceSectionFilter.Builder.sourceIs(Source...)
,
SourceSectionFilter.Builder.mimeTypeIs(String...)
,
SourceSectionFilter.Builder.tagIs(Class...)
,
SourceSectionFilter.Builder.tagIsNot(Class...)
,
SourceSectionFilter.Builder.sourceSectionEquals(SourceSection...)
,
SourceSectionFilter.Builder.indexIn(int, int)
,
SourceSectionFilter.Builder.lineIn(int, int)
,
SourceSectionFilter.Builder.lineIs(int)
,
SourceSectionFilter.Builder.rootNameIs(Predicate)
,
SourceSectionFilter.Builder.build()
public String toString()
public boolean includes(Node node)
node
- The node to check.public boolean includes(RootNode rootNode, SourceSection nodeSourceSection, Set<Class<?>> originalTags)
rootNode
- The root node to be checked against the filter.nodeSourceSection
- The source section of the node to be checked against the filter.true
if the filter includes the source section and node. false
otherwise.