java.lang.Object
org.apache.sling.scripting.sightly.impl.engine.extension.use.ScriptUseProvider
All Implemented Interfaces:
UseProvider

public class ScriptUseProvider extends Object implements UseProvider
Use provider that interprets the identifier as a script path, and runs the respective script using a script engine that matches the script extension.

This provider returns a non-failure outcome only if the evaluated script actually returns something. For more details check the implementation of the SlingScript.eval(SlingBindings) method for the available script engines from your platform.

  • Field Details

  • Constructor Details

    • ScriptUseProvider

      public ScriptUseProvider()
  • Method Details

    • provide

      public ProviderOutcome provide(String scriptName, RenderContext renderContext, Bindings arguments)
      Description copied from interface: UseProvider
      Provide an instance based on the given identifier
      Specified by:
      provide in interface UseProvider
      Parameters:
      scriptName - the identifier of the dependency
      renderContext - the current rendering context
      arguments - specific arguments provided by the use plugin
      Returns:
      a container with the instance that corresponds to the identifier; if the identifier cannot be handled by this provider, a failed outcome is returned.