public final class SourceSectionFilter.Builder extends Object
SourceSectionFilter before creating its instance. Specify various
parameters by calling individual SourceSectionFilter.Builder methods. When done, call SourceSectionFilter.Builder.build().| Modifier and Type | Method and Description |
|---|---|
SourceSectionFilter |
build()
Finalizes and constructs the
SourceSectionFilter instance. |
SourceSectionFilter.Builder |
indexIn(int startIndex,
int length)
Add a filter for all sources sections where the index is inside a startIndex (inclusive)
plus a given length (exclusive).
|
SourceSectionFilter.Builder |
indexIn(SourceSectionFilter.IndexRange... ranges)
Add a filter for all sources sections which indices are contained in one of the given
index ranges.
|
SourceSectionFilter.Builder |
indexNotIn(SourceSectionFilter.IndexRange... ranges)
Add a filter for all sources sections which indices are not contained in one of the given
index ranges.
|
SourceSectionFilter.Builder |
lineEndsIn(SourceSectionFilter.IndexRange... ranges)
Add a filter for all sources sections end in one of the given index ranges.
|
SourceSectionFilter.Builder |
lineIn(int startLine,
int length)
Add a filter for all sources sections where the line is inside a startLine (first index
inclusive) plus a given length (last index exclusive).
|
SourceSectionFilter.Builder |
lineIn(SourceSectionFilter.IndexRange... ranges)
Add a filter for all sources sections which lines are contained in one of the given index
ranges.
|
SourceSectionFilter.Builder |
lineIs(int line)
Add a filter for all sources sections where the line is exactly the given line.
|
SourceSectionFilter.Builder |
lineNotIn(SourceSectionFilter.IndexRange... ranges)
Add a filter for all sources sections which lines are not contained in one of the given
index ranges.
|
SourceSectionFilter.Builder |
lineStartsIn(SourceSectionFilter.IndexRange... ranges)
Add a filter for all sources sections start in one of the given index ranges.
|
SourceSectionFilter.Builder |
mimeTypeIs(String... mimeTypes)
Add a filter for all source sections that declare one of the given mime-types.
|
SourceSectionFilter.Builder |
rootSourceSectionEquals(SourceSection... section)
Add a filter for all root sources sections that equal one of the given source sections.
|
SourceSectionFilter.Builder |
sourceIs(Source... source)
Add a filter for all source sections that reference one of the given sources.
|
SourceSectionFilter.Builder |
sourceIs(SourceSectionFilter.SourcePredicate predicate)
Adds custom predicate to filter inclusion of
sources. |
SourceSectionFilter.Builder |
sourceSectionEquals(SourceSection... section)
Add a filter for all sources sections that equal one of the given source sections.
|
SourceSectionFilter.Builder |
tagIs(Class<?>... tags)
Add a filter for all source sections that are tagged with one of the given String tags.
|
SourceSectionFilter.Builder |
tagIsNot(Class<?>... tags)
Add a filter for all sources sections that declare not one of the given String tags.
|
public SourceSectionFilter.Builder sourceIs(Source... source)
public SourceSectionFilter.Builder sourceIs(SourceSectionFilter.SourcePredicate predicate)
sources. The predicate must
always return the same result for a source instance otherwise the behavior is undefined.
The predicate should be able run on multiple threads at the same time.predicate - a test for inclusionpublic SourceSectionFilter.Builder mimeTypeIs(String... mimeTypes)
mimeTypes - matches one of the given mime typespublic SourceSectionFilter.Builder tagIs(Class<?>... tags)
tags - matches one of the given tagspublic SourceSectionFilter.Builder tagIsNot(Class<?>... tags)
tags - matches not one of the given tagspublic SourceSectionFilter.Builder sourceSectionEquals(SourceSection... section)
section - matches one of the given source sectionspublic SourceSectionFilter.Builder rootSourceSectionEquals(SourceSection... section)
section - matches one of the given root source sectionspublic SourceSectionFilter.Builder indexNotIn(SourceSectionFilter.IndexRange... ranges)
ranges - matches indices that are not contained one of the given index rangespublic SourceSectionFilter.Builder indexIn(SourceSectionFilter.IndexRange... ranges)
ranges - matches indices that are contained one of the given index rangespublic SourceSectionFilter.Builder indexIn(int startIndex, int length)
startIndex - the start index (inclusive)length - the number of matched characterspublic SourceSectionFilter.Builder lineIn(SourceSectionFilter.IndexRange... ranges)
1.ranges - matches lines that are contained one of the given index rangespublic SourceSectionFilter.Builder lineNotIn(SourceSectionFilter.IndexRange... ranges)
1.ranges - matches lines that are not contained one of the given index rangespublic SourceSectionFilter.Builder lineIn(int startLine, int length)
startLine - the start line (inclusive)length - the number of matched linespublic SourceSectionFilter.Builder lineStartsIn(SourceSectionFilter.IndexRange... ranges)
1.ranges - matches lines that start in one of the given index rangespublic SourceSectionFilter.Builder lineEndsIn(SourceSectionFilter.IndexRange... ranges)
1.ranges - matches lines that end in one of the given index rangespublic SourceSectionFilter.Builder lineIs(int line)
1. *line - the line to be matchedpublic SourceSectionFilter build()
SourceSectionFilter instance.