Class ResourceTreeProvider

  • All Implemented Interfaces:
    org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>

    public class ResourceTreeProvider
    extends Object
    implements org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
    • Constructor Detail

      • ResourceTreeProvider

        public ResourceTreeProvider​(org.apache.sling.api.resource.ResourceResolver resolver)
    • Method Detail

      • listChildren

        public Iterator<org.apache.sling.api.resource.Resource> listChildren​(org.apache.sling.api.resource.Resource parent)
        Specified by:
        listChildren in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
      • getParent

        public org.apache.sling.api.resource.Resource getParent​(org.apache.sling.api.resource.Resource element)
        Specified by:
        getParent in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
      • getName

        public String getName​(org.apache.sling.api.resource.Resource element)
        Specified by:
        getName in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
      • getPredicate

        public Predicate<org.apache.sling.api.resource.Resource> getPredicate​(String type,
                                                                              String id,
                                                                              List<Attribute> attributes)
        Specified by:
        getPredicate in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
      • query

        public Iterator<org.apache.sling.api.resource.Resource> query​(List<SelectorSegment> segments,
                                                                      org.apache.sling.api.resource.Resource resource)
        Specified by:
        query in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
      • sameElement

        public boolean sameElement​(org.apache.sling.api.resource.Resource o1,
                                   org.apache.sling.api.resource.Resource o2)
        Specified by:
        sameElement in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>
      • isDescendant

        public boolean isDescendant​(org.apache.sling.api.resource.Resource root,
                                    org.apache.sling.api.resource.Resource testedElement)
        Specified by:
        isDescendant in interface org.apache.sling.query.api.internal.TreeProvider<org.apache.sling.api.resource.Resource>