Interface UseWithRenderContext

  • All Known Implementing Classes:
    AttributeHelper

    public interface UseWithRenderContext
    Allows initialization of Java objects when created by HTL with ExtendedJavaUseProvider.
    Since:
    09/2017
    Author:
    Hans-Peter Stoerr
    See Also:
    Use
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void init​(org.apache.sling.scripting.sightly.render.RenderContext renderContext, Bindings arguments)
      Called to initialize the Java object with the current Java Scripting API arguments.
    • Method Detail

      • init

        void init​(org.apache.sling.scripting.sightly.render.RenderContext renderContext,
                  Bindings arguments)

        Called to initialize the Java object with the current Java Scripting API arguments.

        This method is called only if the object has been instantiated by HTL as part of processing the data-sly-use attribute. The Java Scripting API arguments provide all the global variables known to a script being executed.

        Parameters:
        renderContext - the context where this is called. Caution: modifying RenderContext.getBindings() will change the global bindings.
        arguments - The Java Scripting API arguments. Caution: modifying this could interfere with other providers.