Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Refine TypeProcessor - allow scanning TypeSystem without repeating filters. #797

Conversation

christophstrobl
Copy link
Contributor

Introduce TypeProcessor.filter(...) and TypeProcessor.limitInspectionDepth(...) to allow filtering candidate Types based on a single filter instead of repeated ones.
The inspection depth limit, defines the maximum number of hops allowed during signature traversal.

Given a structure like below, and a limit of 1, the type registration callback is invoked for Level0, SomeInterface
and Level1, but not for Level2.
Setting the limit to 0, the callback is only invoked for Level0.

class Level0 implements SomeInterface {
    Level1 level1;
}
class Level1 {
    Level2 level2;
}
class Level2 {
    // ...
}

Along the lines introduce a DiscoveryContext that provides access to the Path that leads to a certain type. That way, type registration callbacks can decide upon more information.

…lters.

Introduce TypeProcessor.filter and inspection depth to allow filtering candidate Types based on a single filter instead of repeated ones.
The inspection limit, defines the maximum number of hops allowed when inspecting types and their signatures.

Given a structure like below, and a level of 1 the callback would be invoked for Level0, SomeInterface
and Level1, but not for Level2.
When using level 0, the callback is only invoked for Level0.

class Level0 implements SomeInterface {
    Level1 level1;
}
class Level1 {
    Level2 level2;
}
class Level2 {
    // ...
}

Also introduce a DiscoveryContext that provides access to the Path that lead to a certain type. That way type registration callbacks can decide upon more information what to do.
@christophstrobl christophstrobl added the type: enhancement A general enhancement label May 26, 2021
@christophstrobl christophstrobl requested a review from sdeleuze May 26, 2021 08:54
@sdeleuze sdeleuze added this to the 0.10.0 milestone May 26, 2021
@sdeleuze sdeleuze merged commit 6870817 into spring-attic:main May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: enhancement A general enhancement
Development

Successfully merging this pull request may close these issues.

2 participants