Class SyntheticLinkResource

  • All Implemented Interfaces:
    org.apache.sling.api.adapter.Adaptable, org.apache.sling.api.resource.Resource

    @ProviderType
    public final class SyntheticLinkResource
    extends org.apache.sling.api.resource.SyntheticResource
    Synthetic resource for building links via LinkHandler. Use properties with names provided by LinkNameConstants.
    • Field Summary

      • Fields inherited from interface org.apache.sling.api.resource.Resource

        RESOURCE_TYPE_NON_EXISTING
    • Constructor Summary

      Constructors 
      Constructor Description
      SyntheticLinkResource​(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull java.lang.String path)
      Instantiate resource with static path/resource type
      SyntheticLinkResource​(@NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver, @NotNull java.lang.String path, @NotNull java.util.Map<java.lang.String,​java.lang.Object> properties)
      Instantiate resource with static path/resource type
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <Type> Type adaptTo​(java.lang.Class<Type> type)  
      • Methods inherited from class org.apache.sling.api.resource.SyntheticResource

        getPath, getResourceMetadata, getResourceResolver, getResourceSuperType, getResourceType, toString
      • Methods inherited from class org.apache.sling.api.resource.AbstractResource

        getChild, getChildren, getName, getParent, getValueMap, hasChildren, isResourceType, listChildren
      • Methods inherited from class org.apache.sling.api.adapter.SlingAdaptable

        setAdapterManager, unsetAdapterManager
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SyntheticLinkResource

        public SyntheticLinkResource​(@NotNull
                                     @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                     @NotNull
                                     @NotNull java.lang.String path)
        Instantiate resource with static path/resource type
        Parameters:
        resourceResolver - Resource resolver
        path - Resource path. Can be a non-existing path, but the path should be located somewhere within the applications content paths to make sure the handler configuration looked up via context-aware services is the expected one.
      • SyntheticLinkResource

        public SyntheticLinkResource​(@NotNull
                                     @NotNull org.apache.sling.api.resource.ResourceResolver resourceResolver,
                                     @NotNull
                                     @NotNull java.lang.String path,
                                     @NotNull
                                     @NotNull java.util.Map<java.lang.String,​java.lang.Object> properties)
        Instantiate resource with static path/resource type
        Parameters:
        resourceResolver - Resource resolver
        path - Resource path. Can be a non-existing path, but the path should be located somewhere within the applications content paths to make sure the handler configuration looked up via context-aware services is the expected one.
        properties - Properties for resource
    • Method Detail

      • adaptTo

        public <Type> Type adaptTo​(java.lang.Class<Type> type)
        Specified by:
        adaptTo in interface org.apache.sling.api.adapter.Adaptable
        Overrides:
        adaptTo in class org.apache.sling.api.adapter.SlingAdaptable