Class OriginalResourceTypeViaProvider

java.lang.Object
org.apache.sling.models.impl.via.OriginalResourceTypeViaProvider
All Implemented Interfaces:
org.apache.sling.models.spi.ViaProvider

public class OriginalResourceTypeViaProvider extends Object implements org.apache.sling.models.spi.ViaProvider
This ViaProvider implements the counterpart of the ForcedResourceTypeViaProvider and the ResourceSuperTypeViaProvider. It is in particular helpful in models that want to inject another model using the original Resource's or SlingHttpServletRequest's resource type instead of the one forced by either of the above-mentioned ViaProviders

The implementation simply unwraps the ResourceWrapper or SlingHttpServletRequestWrapper used by the ForcedResourceTypeViaProvider and ResourceSuperTypeViaProvider.

  • Constructor Details

    • OriginalResourceTypeViaProvider

      public OriginalResourceTypeViaProvider()
  • Method Details

    • getType

      public Class<? extends org.apache.sling.models.annotations.ViaProviderType> getType()
      Specified by:
      getType in interface org.apache.sling.models.spi.ViaProvider
    • getAdaptable

      public Object getAdaptable(Object original, String value)
      Specified by:
      getAdaptable in interface org.apache.sling.models.spi.ViaProvider