Class BindingsUtils
java.lang.Object
org.apache.sling.scripting.sightly.impl.utils.BindingsUtils
BindingsUtils provides helper methods for retrieving commonly used objects from a Bindings map.-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.sling.api.scripting.SlingScriptHelperRetrieves theSlingScriptHelperfrom aBindingsmap.static org.apache.sling.api.SlingJakartaHttpServletRequestgetJakartaRequest(Bindings bindings) Retrieves theSlingJakartaHttpServletRequestfrom aBindingsmap.static org.apache.sling.api.SlingJakartaHttpServletResponsegetJakartaResponse(Bindings bindings) Retrieves theSlingJakartaHttpServletResponsefrom aBindingsmap.static org.apache.sling.api.SlingHttpServletRequestgetRequest(Bindings bindings) Deprecated.static org.apache.sling.api.resource.ResourcegetResource(Bindings bindings) Retrieves theResourcefrom aBindingsmap.static org.apache.sling.api.SlingHttpServletResponsegetResponse(Bindings bindings) Deprecated.usegetJakartaResponse(Bindings)insteadstatic BindingsCombine two bindings objects.
-
Method Details
-
getResource
Retrieves theResourcefrom aBindingsmap.- Parameters:
bindings- the bindings map- Returns:
- the
Resourceif found,nullotherwise
-
getRequest
@Deprecated(since="2.0.0-1.4.0") public static org.apache.sling.api.SlingHttpServletRequest getRequest(Bindings bindings) Deprecated.usegetJakartaRequest(Bindings)insteadRetrieves theSlingHttpServletRequestfrom aBindingsmap.- Parameters:
bindings- the bindings maps- Returns:
- the
SlingHttpServletRequestif found,nullotherwise
-
getResponse
@Deprecated(since="2.0.0-1.4.0") public static org.apache.sling.api.SlingHttpServletResponse getResponse(Bindings bindings) Deprecated.usegetJakartaResponse(Bindings)insteadRetrieves theSlingHttpServletResponsefrom aBindingsmap.- Parameters:
bindings- the bindings maps- Returns:
- the
SlingHttpServletResponseif found,nullotherwise
-
getJakartaRequest
public static org.apache.sling.api.SlingJakartaHttpServletRequest getJakartaRequest(Bindings bindings) Retrieves theSlingJakartaHttpServletRequestfrom aBindingsmap.- Parameters:
bindings- the bindings maps- Returns:
- the
SlingJakartaHttpServletRequestif found,nullotherwise
-
getJakartaResponse
public static org.apache.sling.api.SlingJakartaHttpServletResponse getJakartaResponse(Bindings bindings) Retrieves theSlingJakartaHttpServletResponsefrom aBindingsmap.- Parameters:
bindings- the bindings maps- Returns:
- the
SlingJakartaHttpServletResponseif found,nullotherwise
-
getHelper
Retrieves theSlingScriptHelperfrom aBindingsmap.- Parameters:
bindings- the bindings map- Returns:
- the
SlingScriptHelperif found,nullotherwise
-
merge
Combine two bindings objects. Priority goes to latter bindings.- Parameters:
former- first map of bindingslatter- second map of bindings, which can override the fist one- Returns:
- the merging of the two maps
-
getJakartaRequest(Bindings)instead