Class SourceFilter.Builder
java.lang.Object
com.oracle.truffle.api.instrumentation.SourceFilter.Builder
- Enclosing class:
SourceFilter
Configure your own
SourceFilter before creating its instance. Specify various
parameters by calling individual SourceFilter.Builder methods. When done, call build().- Since:
- 0.32
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Finalizes and constructs theSourceFilterinstance.includeInternal(boolean internal) Add a filter that includes or excludesinternal sources.languageIs(String... languageIds) Add a filter for all sources that specify one of the givenlanguage ID.Add a filter for one of the given sources.Adds custom predicate to filter inclusion ofsources.
-
Method Details
-
sourceIs
Add a filter for one of the given sources.- Since:
- 0.32
-
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 source inclusion- Since:
- 0.32
-
languageIs
Add a filter for all sources that specify one of the givenlanguage ID.- Parameters:
languageIds- matches one of the given language ID- Returns:
- the builder to chain calls
- Since:
- 0.32
-
includeInternal
Add a filter that includes or excludesinternal sources. By default, internal sources are included, call withfalseto exclude internal code from instrumentation.- Returns:
- the builder to chain calls
- Since:
- 0.32
-
build
Finalizes and constructs theSourceFilterinstance.- Returns:
- the built filter expression
- Since:
- 0.32
-