Class ValueMapResource

    • Constructor Detail

      • ValueMapResource

        public ValueMapResource​(ResourceResolver resourceResolver,
                                java.lang.String path,
                                java.lang.String resourceType)
        Instantiates with an empty ValueMap initially.
        Parameters:
        resourceResolver - The resource resolver
        path - The resource path
        resourceType - The resource type
      • ValueMapResource

        public ValueMapResource​(ResourceResolver resourceResolver,
                                java.lang.String path,
                                java.lang.String resourceType,
                                @Nonnull
                                ValueMap vm)
        Instantiates with the given ValueMap.
        Parameters:
        resourceResolver - The resource resolver
        path - The resource path
        resourceType - The resource type
        vm - The ValueMap of the resource
      • ValueMapResource

        public ValueMapResource​(ResourceResolver resourceResolver,
                                java.lang.String path,
                                java.lang.String resourceType,
                                @Nonnull
                                ValueMap vm,
                                @CheckForNull
                                java.util.Collection<Resource> children)
        Instantiates with the given child resources.
        Parameters:
        resourceResolver - The resource resolver
        path - The resource path
        resourceType - The resource type
        vm - The ValueMap of the resource
        children - The children of the resource
      • ValueMapResource

        public ValueMapResource​(ResourceResolver resourceResolver,
                                ResourceMetadata rm,
                                java.lang.String resourceType)
        Instantiates with an empty ValueMap initially.
        Parameters:
        resourceResolver - The resource resolver
        rm - The resource meta data
        resourceType - The resource type
      • ValueMapResource

        public ValueMapResource​(ResourceResolver resourceResolver,
                                ResourceMetadata rm,
                                java.lang.String resourceType,
                                @Nonnull
                                ValueMap vm)
        Instantiates with the given ValueMap.
        Parameters:
        resourceResolver - The resource resolver
        rm - The resource meta data
        resourceType - The resource type
        vm - The ValueMap of the resource
      • ValueMapResource

        public ValueMapResource​(ResourceResolver resourceResolver,
                                ResourceMetadata rm,
                                java.lang.String resourceType,
                                @Nonnull
                                ValueMap vm,
                                @CheckForNull
                                java.util.Collection<Resource> children)
        Instantiates with the given child resources.
        Parameters:
        resourceResolver - The resource resolver
        rm - The resource meta data
        resourceType - The resource type
        vm - The ValueMap of the resource
        children - The children of the resource
    • Method Detail

      • adaptTo

        public <Type> Type adaptTo​(java.lang.Class<Type> type)
        Description copied from class: SlingAdaptable
        Calls into the registered AdapterManager to adapt this object to the desired type.

        This method implements a cache of adapters to improve performance. That is repeated calls to this method with the same class will result in the same object to be returned.

        Specified by:
        adaptTo in interface Adaptable
        Overrides:
        adaptTo in class SlingAdaptable
        Type Parameters:
        Type - The generic type to which this resource is adapted to
        Parameters:
        type - The Class object of the target type, such as javax.jcr.Node.class or java.io.File.class
        Returns:
        The adapter target or null if the resource cannot adapt to the requested type
      • getChildren

        public java.lang.Iterable<Resource> getChildren()
        Description copied from interface: Resource
        Returns an iterable of the direct children of this resource.

        This method is a convenience and returns exactly the same resources as calling getResourceResolver().getChildren(resource).

        Specified by:
        getChildren in interface Resource
        Overrides:
        getChildren in class AbstractResource
        Returns:
        An iterable for child resources
        See Also:
        Resource.getChildren()