Interface VeneeredResource

    • Method Detail

      • getResource

        Resource getResource()
        Get the underlying resource for this instance.
        Returns:
        current resource
      • getResourceResolver

        ResourceResolver getResourceResolver()
        Get the Resource Resolver for the underlying Sling resource.
        Returns:
        resource resolver
      • getResourceType

        String getResourceType()
        Get the underlying Sling resource type.
        Returns:
        resource type
      • getResourceSuperType

        String getResourceSuperType()
        Get the underlying Sling resource super type.
        Returns:
        resource super type
      • getId

        String getId()
        Get the unique ID for this resource based on the path. If this resource is the descendant of a page, the page path will be removed from the identifier, since the relative path of a veneered resource is always unique for a page.
        Returns:
        unique ID
      • getIndex

        int getIndex()
        Get the index of this resource in relation to sibling resources.
        Returns:
        index in sibling resources or -1 if resource is null or has null parent resource
      • getIndex

        int getIndex​(String resourceType)
        Get the index of this resource in relation to sibling resources, ignoring resource types that do not match the specified value.
        Parameters:
        resourceType - sling:resourceType to filter on
        Returns:
        index in sibling resources or -1 if resource is null or has null parent resource
      • getResource

        Optional<VeneeredResource> getResource​(String relativePath)
        Get the veneered resource for the resource at the given path relative to the current resource.
        Parameters:
        relativePath - relative path to component
        Returns:
        Optional resource for component
      • getResources

        List<VeneeredResource> getResources()
        Get a list of child resources for the current resource.
        Returns:
        list of veneered resources or empty list if none exist
      • getResources

        List<VeneeredResource> getResources​(Predicate<VeneeredResource> predicate)
        Get a predicate-filtered list of child resources for the current resource.
        Parameters:
        predicate - predicate used to filter resources
        Returns:
        list of veneered resources that meet the predicate criteria or empty list if none exist
      • getResources

        List<VeneeredResource> getResources​(String relativePath)
        Get a list of child resources for the resource at the given path relative to this resource.
        Parameters:
        relativePath - relative path to parent of desired resources
        Returns:
        list of veneered resources below the specified relative path or empty list if none exist
      • getResources

        List<VeneeredResource> getResources​(String relativePath,
                                            String resourceType)
        Get a list of child resources for the resource at the given path relative to this resource, returning only the resources that have the specified resource type.
        Parameters:
        relativePath - relative path to parent of desired resources
        resourceType - sling:resourceType of resources to get from parent resource
        Returns:
        list of veneered resources matching the given resource type below the specified relative path or empty list if none exist
      • getResources

        List<VeneeredResource> getResources​(String relativePath,
                                            Predicate<VeneeredResource> predicate)
        Get a list of child resources for the resource at the given path relative to this resource, returning only the resources that meet the predicate criteria.
        Parameters:
        relativePath - relative path to parent of desired resources
        predicate - predicate used to filter resources
        Returns:
        list of veneered resources that meet the predicate criteria below the specified relative path or empty list if none exist
      • getParent

        VeneeredResource getParent()
        Get the parent of this resource.
        Returns:
        parent veneered resource or absent optional if resource has no parent
      • getContainingPage

        Optional<VeneeredPage> getContainingPage()
        Get the page containing this resource.
        Returns:
        optional containing page