Class BindingsUtils


  • public class BindingsUtils
    extends Object
    BindingsUtils provides helper methods for retrieving commonly used objects from a Bindings map.
    • Constructor Detail

      • BindingsUtils

        public BindingsUtils()
    • Method Detail

      • getResource

        public static org.apache.sling.api.resource.Resource getResource​(Bindings bindings)
        Retrieves the Resource from a Bindings map.
        Parameters:
        bindings - the bindings map
        Returns:
        the Resource if found, null otherwise
      • getRequest

        public static org.apache.sling.api.SlingHttpServletRequest getRequest​(Bindings bindings)
        Retrieves the SlingHttpServletRequest from a Bindings map.
        Parameters:
        bindings - the bindings maps
        Returns:
        the SlingHttpServletRequest if found, null otherwise
      • getResponse

        public static org.apache.sling.api.SlingHttpServletResponse getResponse​(Bindings bindings)
        Retrieves the SlingHttpServletResponse from a Bindings map.
        Parameters:
        bindings - the bindings maps
        Returns:
        the SlingHttpServletResponse if found, null otherwise
      • getHelper

        public static org.apache.sling.api.scripting.SlingScriptHelper getHelper​(Bindings bindings)
        Retrieves the SlingScriptHelper from a Bindings map.
        Parameters:
        bindings - the bindings map
        Returns:
        the SlingScriptHelper if found, null otherwise
      • merge

        public static Bindings merge​(Bindings former,
                                     Bindings latter)
        Combine two bindings objects. Priority goes to latter bindings.
        Parameters:
        former - first map of bindings
        latter - second map of bindings, which can override the fist one
        Returns:
        the merging of the two maps