Class SourceSectionFilter.Builder
java.lang.Object
com.oracle.truffle.api.instrumentation.SourceSectionFilter.Builder
- Enclosing class:
SourceSectionFilter
Configure your own
SourceSectionFilter
before creating its instance. Specify various
parameters by calling individual SourceSectionFilter.Builder
methods. When done, call build()
.- Since:
- 0.12
-
Method Summary
Modifier and TypeMethodDescriptionand
(SourceSectionFilter filter) Adds all the filters defined in the givenfilter
.build()
Finalizes and constructs theSourceSectionFilter
instance.columnEndsIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all sources sections where the column ends in one of the given index ranges.columnIn
(int startColumn, int length) Add a filter for all source sections where the column is inside a startColumn (first index inclusive) plus a given length (last index exclusive).columnIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where the columns are contained in one of the given index ranges.columnNotIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where columns are not contained in one of the given index ranges.columnStartsIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where the column starts in one of the given index ranges.includeInternal
(boolean internal) Add a filter that includes or excludesinternal root nodes
.indexIn
(int startIndex, int length) Add a filter for all source sections where the index is inside a startIndex (inclusive) plus a given length (exclusive).indexIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections which indices are contained in one of the given index ranges.indexNotIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections which indices are not contained in one of the given index ranges.lineEndsIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where the line ends in one of the given index ranges.lineIn
(int startLine, int length) Add a filter for all source sections where the line is inside a startLine (first index inclusive) plus a given length (last index exclusive).lineIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where lines are contained in one of the given index ranges.lineIs
(int line) Add a filter for all sources sections where the line is exactly the given line.lineNotIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where lines are not contained in one of the given index ranges.lineStartsIn
(SourceSectionFilter.IndexRange... ranges) Add a filter for all source sections where the line starts in one of the given index ranges.mimeTypeIs
(String... mimeTypes) Add a filter for all source sections that declare one of the given mime-types.rootNameIs
(Predicate<String> predicate) Adds custom predicate to filter inclusion forroot names
.rootSourceSectionEquals
(SourceSection... section) Add a filter for all root source sections that equal one of the given source sections.sourceFilter
(SourceFilter sourceFilter) Add a source filter.sourceIs
(SourceSectionFilter.SourcePredicate predicate) Adds custom predicate to filter inclusion ofsources
.Add a filter for all source sections that reference one of the given sources.sourceSectionAvailableOnly
(boolean availableOnly) Add a filter for available source sections.sourceSectionEquals
(SourceSection... section) Add a filter for all source sections that equal one of the given source sections.Add a filter for all source sections that are tagged with one of the given tags.Add a filter for all source sections that are not tagged with one of the given tags.
-
Method Details
-
sourceFilter
Add a source filter.- Since:
- 0.32
-
sourceIs
Add a filter for all source sections that reference one of the given sources.- Since:
- 0.12
-
sourceIs
Adds custom predicate to filter inclusion ofsources
. 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.- Parameters:
predicate
- a test for inclusion- Since:
- 0.17
-
rootNameIs
Adds custom predicate to filter inclusion forroot names
. The root name might benull
if not provided by the guest language. If the language returns a changing value it is unspecified which root name is going to be matched. The predicate must always return the same result for aString
instance otherwise the behavior is undefined. The predicate should be able run on multiple threads at the same time.- Parameters:
predicate
- a test for inclusion- Since:
- 0.27
-
mimeTypeIs
Add a filter for all source sections that declare one of the given mime-types. Mime-types which are compared must match exactly one of the mime-types specified by the target guest language.- Parameters:
mimeTypes
- matches one of the given mime types- Returns:
- the builder to chain calls
- Since:
- 0.12
-
tagIs
Add a filter for all source sections that are tagged with one of the given tags.- Parameters:
tags
- matches one of the given tags- Returns:
- the builder to chain calls
- Since:
- 0.12
-
tagIsNot
Add a filter for all source sections that are not tagged with one of the given tags.- Parameters:
tags
- matches not one of the given tags- Returns:
- the builder to chain calls
- Since:
- 0.12
-
sourceSectionEquals
Add a filter for all source sections that equal one of the given source sections.- Parameters:
section
- matches one of the given source sections- Returns:
- the builder to chain calls
- Since:
- 0.12
-
sourceSectionAvailableOnly
Add a filter for available source sections. By default all locations with or without available source sections are provided. If this flag is set totrue
thennull
and notavailable
source sections are filtered out.- Parameters:
availableOnly
-true
to include only non-null andavailable
source sections,false
to include all.- Returns:
- the builder to chain calls
- Since:
- 24.1
-
rootSourceSectionEquals
Add a filter for all root source sections that equal one of the given source sections. All descendant source sections of a matching root source section are included in the filter. This can mean in the dynamic language domain that all nodes of a function for which the root source section matches the given source section is instrumented but its inner functions and its nodes are not instrumented.- Parameters:
section
- matches one of the given root source sections- Returns:
- the builder to chain calls
- Since:
- 0.12
-
indexNotIn
Add a filter for all source sections which indices are not contained in one of the given index ranges.- Parameters:
ranges
- matches indices that are not contained in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.12
-
indexIn
Add a filter for all source sections which indices are contained in one of the given index ranges.- Parameters:
ranges
- matches indices that are contained in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.12
-
indexIn
Add a filter for all source sections where the index is inside a startIndex (inclusive) plus a given length (exclusive).- Parameters:
startIndex
- the start index (inclusive)length
- the number of matched characters- Returns:
- the builder to chain calls
- Since:
- 0.12
-
lineIn
Add a filter for all source sections where lines are contained in one of the given index ranges. Line indices must be greater than or equal to1
.- Parameters:
ranges
- matches lines that are contained in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.12
-
lineNotIn
Add a filter for all source sections where lines are not contained in one of the given index ranges. Line indices must be greater than or equal to1
.- Parameters:
ranges
- matches lines that are not contained in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.12
-
lineIn
Add a filter for all source sections where the line is inside a startLine (first index inclusive) plus a given length (last index exclusive).- Parameters:
startLine
- the start line (inclusive)length
- the number of matched lines- Returns:
- the builder to chain calls
- Since:
- 0.12
-
lineStartsIn
Add a filter for all source sections where the line starts in one of the given index ranges. Line indices must be greater than or equal to1
.- Parameters:
ranges
- matches lines that start in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.12
-
lineEndsIn
Add a filter for all source sections where the line ends in one of the given index ranges. Line indices must be greater than or equal to1
.- Parameters:
ranges
- matches lines that end in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.12
-
columnIn
Add a filter for all source sections where the columns are contained in one of the given index ranges. Column indices must be greater than or equal to1
.- Parameters:
ranges
- matches columns that are contained in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.33
-
columnNotIn
Add a filter for all source sections where columns are not contained in one of the given index ranges. Column indices must be greater than or equal to1
.- Parameters:
ranges
- matches columns that are not contained in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.33
-
columnIn
Add a filter for all source sections where the column is inside a startColumn (first index inclusive) plus a given length (last index exclusive).- Parameters:
startColumn
- the start column (inclusive)length
- the number of matched columns- Returns:
- the builder to chain calls
- Since:
- 0.33
-
columnStartsIn
Add a filter for all source sections where the column starts in one of the given index ranges. Column indices must be greater than or equal to1
.- Parameters:
ranges
- matches columns that start in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.33
-
columnEndsIn
Add a filter for all sources sections where the column ends in one of the given index ranges. Column indices must be greater than or equal to1
.- Parameters:
ranges
- matches columns that end in one of the given index ranges- Returns:
- the builder to chain calls
- Since:
- 0.33
-
lineIs
Add a filter for all sources sections where the line is exactly the given line. Line indices must be greater than or equal to1
. *- Parameters:
line
- the line to be matched- Returns:
- the builder to chain calls
- Since:
- 0.12
-
includeInternal
Add a filter that includes or excludesinternal root nodes
. By default, internal roots are included, call withfalse
to exclude internal code from instrumentation.- Returns:
- the builder to chain calls
- Since:
- 0.29
-
and
Adds all the filters defined in the givenfilter
.- Parameters:
filter
- an existing filter to be included- Returns:
- the builder to chain calls
- Since:
- 0.30
-
build
Finalizes and constructs theSourceSectionFilter
instance.- Returns:
- the built filter expression
- Since:
- 0.12
-