Class ValueMapResourceWrapper

  • All Implemented Interfaces:
    Adaptable, Resource

    public class ValueMapResourceWrapper
    extends ResourceWrapper
    A resource wrapper that wraps an underlying resource with an empty ValueMap}, which can be modified accordingly. It is used for the scenario where we want to control the ValueMap returned by a resource.
    • Constructor Detail

      • ValueMapResourceWrapper

        public ValueMapResourceWrapper​(@Nonnull
                                       Resource resource,
                                       java.lang.String resourceType)
        Instantiates a new wrapper.
        Parameters:
        resource - The resource to wrap
        resourceType - The resource type of the resource wrapper
    • Method Detail

      • adaptTo

        public <AdapterType> AdapterType adaptTo​(java.lang.Class<AdapterType> type)
        Description copied from class: ResourceWrapper
        Returns the value of calling adaptTo on the wrapped resource.
        Specified by:
        adaptTo in interface Adaptable
        Overrides:
        adaptTo in class ResourceWrapper
        Type Parameters:
        AdapterType - The generic type to which this object 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 object cannot adapt to the requested type