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
Nested ClassesModifier and TypeClassDescriptionfinal classConfigure your ownSourceSectionFilterbefore creating its instance.static final classRepresents a range between two indices within asource section filter.static interfaceRepresents a predicate for source objects. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SourceSectionFilterA filter that matches everything. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the filter includes the given node, i.e.booleanincludes(RootNode rootNode, SourceSection nodeSourceSection, Set<Class<?>> originalTags) Checks if the filter includes the given root node, i.e.static SourceSectionFilter.BuilderCreates a newSourceSectionFilterexpression using abuilderpattern.toString()
-
Field Details
-
ANY
-
-
Method Details
-
newBuilder
Creates a newSourceSectionFilterexpression using abuilderpattern. 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
SourceSectionFilterinstances - 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:
trueif the filter includes the source section and node.falseotherwise.- Since:
- 21.3.0
-