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.
        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
        adaptTo in class ResourceWrapper
        Type Parameters:
        AdapterType - The generic type to which this object is adapted to
        type - The Class object of the target type, such as javax.jcr.Node.class or
        The adapter target or null if the object cannot adapt to the requested type