Package org.apache.sling.query.impl.resource

## Class ResourceTreeProvider

- java.lang.Object
- - org.apache.sling.query.impl.resource.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 Summary

Constructors
`ResourceTreeProvider​(org.apache.sling.api.resource.ResourceResolver resolver)`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getName​(org.apache.sling.api.resource.Resource element)`
`org.apache.sling.api.resource.Resource` `getParent​(org.apache.sling.api.resource.Resource element)`
`Predicate<org.apache.sling.api.resource.Resource>` `getPredicate​(String type, String id, List<Attribute> attributes)`
`boolean` `isDescendant​(org.apache.sling.api.resource.Resource root, org.apache.sling.api.resource.Resource testedElement)`
`Iterator<org.apache.sling.api.resource.Resource>` `listChildren​(org.apache.sling.api.resource.Resource parent)`
`Iterator<org.apache.sling.api.resource.Resource>` `query​(List<SelectorSegment> segments, org.apache.sling.api.resource.Resource resource)`
`boolean` `sameElement​(org.apache.sling.api.resource.Resource o1, org.apache.sling.api.resource.Resource o2)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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>`