Class SourceFilter.Builder

java.lang.Object
com.oracle.truffle.api.instrumentation.SourceFilter.Builder
Enclosing class:
SourceFilter

public final class SourceFilter.Builder extends Object
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 Details

    • sourceIs

      public SourceFilter.Builder sourceIs(Source... source)
      Add a filter for one of the given sources.
      Since:
      0.32
    • sourceIs

      public SourceFilter.Builder sourceIs(Predicate<Source> predicate)
      Adds custom predicate to filter inclusion of 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.
      Parameters:
      predicate - a test for source inclusion
      Since:
      0.32
    • languageIs

      public SourceFilter.Builder languageIs(String... languageIds)
      Add a filter for all sources that specify one of the given language ID.
      Parameters:
      languageIds - matches one of the given language ID
      Returns:
      the builder to chain calls
      Since:
      0.32
    • includeInternal

      public SourceFilter.Builder includeInternal(boolean internal)
      Add a filter that includes or excludes internal sources. By default, internal sources are included, call with false to exclude internal code from instrumentation.
      Returns:
      the builder to chain calls
      Since:
      0.32
    • build

      public SourceFilter build()
      Finalizes and constructs the SourceFilter instance.
      Returns:
      the built filter expression
      Since:
      0.32