Class SourceSectionFilter
java.lang.Object
com.oracle.truffle.api.instrumentation.SourceSectionFilter
A source section filter represents an expression for a subset of tagged source sections that are
used in an Truffle interpreter.
Start building event filters by calling newBuilder()
and complete
them by calling SourceSectionFilter.Builder.build()
.
- Since:
- 0.12
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionfinal class
Configure your ownSourceSectionFilter
before creating its instance.static final class
Represents a range between two indices within asource section filter
.static interface
Represents a predicate for source objects. -
Field Summary
Modifier and TypeFieldDescriptionstatic final SourceSectionFilter
A filter that matches everything. -
Method Summary
Modifier and TypeMethodDescriptionboolean
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
Creates a newSourceSectionFilter
expression using abuilder
pattern.toString()
-
Field Details
-
ANY
A filter that matches everything.- Since:
- 0.18
-
-
Method Details
-
newBuilder
Creates a newSourceSectionFilter
expression using abuilder
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 usingSourceSectionFilter.Builder.build()
.- Returns:
- a new builder to create new
SourceSectionFilter
instances - Since:
- 0.12
- See Also:
-
toString
-
includes
Checks if the filter includes the given node, i.e. do the properties of the node's source section meet the conditions set by the filter.- Parameters:
node
- The node to check.- Returns:
- True of the filter includes the node, false otherwise.
- Since:
- 19.0.
-
includes
public boolean includes(RootNode rootNode, SourceSection nodeSourceSection, Set<Class<?>> originalTags) Checks if the filter includes the given root node, i.e. do the properties of the given source section meet the conditions set by the filter without an instrumented node.- Parameters:
rootNode
- The root node to be checked against the filter.nodeSourceSection
- The source section of the node to be checked against the filter.- Returns:
true
if the filter includes the source section and node.false
otherwise.- Since:
- 21.3.0
-