Class NearestSectionFilter
The selection of the nearest source location happens based on the provided
SourceSectionFilter and this nearest section filter to the Instrumenter
create/attach methods. First location candidates are selected according to the
SourceSectionFilter. Based on this selection a nearest location is found using this
NearestSectionFilter. If new nearer locations are loaded then the listener/factory will
be notified again. There is at most one nearest SourceSection at a time, therefore it is
possible to detect updates by remembering and comparing the source section in the
listener/factory.
Start building the nearest filter by calling newBuilder(int, int)
and complete it by calling NearestSectionFilter.Builder.build().
A use-case is a debugger breakpoint, for instance, where the exact line or column is not always precise and the location needs to be updated when new code is loaded.
- Since:
- 23.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder to configureNearestSectionFilterbefore creating its instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic NearestSectionFilter.BuildernewBuilder(int line, int column) Creates a newNearestSectionFilterusing abuilderpattern.toString()
-
Method Details
-
newBuilder
Creates a newNearestSectionFilterusing abuilderpattern. The filter will find source sections that are nearest to the given source line and column. To create the final filter finalize it usingNearestSectionFilter.Builder.build().- Parameters:
line- the line, greater than or equal to1column- the column, or < 1 when column is unknown- Returns:
- a new builder to create new
NearestSectionFilterinstances - Since:
- 23.0
-
toString
-