[ 
https://issues.apache.org/jira/browse/SLING-8271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16772764#comment-16772764
 ] 

Konrad Windszus commented on SLING-8271:
----------------------------------------

After having a second thought I think it would be good to allow to stop 
traversal at all (not only stop visiting the child resources). This will be 
hard though to implement in a backwards compatible fashion, so I rather would 
deprecate the old AbstractResourceVisitor and come up with a new class which 
allows to influence the traversal behaviour. I therefore reverted 
https://github.com/apache/sling-org-apache-sling-api/commit/36dcee948a3a92fc402bc5d3fab6ec4c2b8038a5
 in 
https://github.com/apache/sling-org-apache-sling-api/commit/6c82bfa4a8a3344f6cde99a29c2a3097d243d8e5.

> Improve AbstractResourceVisitor to allow to stop visiting child resources
> -------------------------------------------------------------------------
>
>                 Key: SLING-8271
>                 URL: https://issues.apache.org/jira/browse/SLING-8271
>             Project: Sling
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: API 2.20.0
>            Reporter: Konrad Windszus
>            Assignee: Konrad Windszus
>            Priority: Major
>             Fix For: API 2.20.2
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> Currently the AbstractResourceVisitor 
> (https://github.com/apache/sling-org-apache-sling-api/blob/master/src/main/java/org/apache/sling/api/resource/AbstractResourceVisitor.java)
>  completely decouples the {{visit}} method from the actual resource 
> traversal. That means it is currently rather hard to programmatically add a 
> break condition which should lead to no further descending into child 
> resources.
> I propose to extend {{AbstractResourceVisitor}} by an additional visit method 
> which is supposed to return a boolean value. Only if {{true}} is returned it 
> will further descend into the children of the current resource. The default 
> implementation should just return {{true}} to make this change backwards 
> compatible.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to