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.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SlingScriptHelperRetrieves theSlingScriptHelperfrom aBindingsmap.static SlingHttpServletRequestgetRequest(Bindings bindings) Retrieves theSlingHttpServletRequestfrom aBindingsmap.static ResourcegetResource(Bindings bindings) static SlingHttpServletResponsegetResponse(Bindings bindings) Retrieves theSlingHttpServletResponsefrom aBindingsmap.static BindingsCombine two bindings objects.
-
Constructor Details
-
BindingsUtils
public BindingsUtils()
-
-
Method Details
-
getResource
- Parameters:
bindings- the bindings map- Returns:
- the
Resourceif found,nullotherwise
-
getRequest
Retrieves theSlingHttpServletRequestfrom aBindingsmap.- Parameters:
bindings- the bindings maps- Returns:
- the
SlingHttpServletRequestif found,nullotherwise
-
getResponse
Retrieves theSlingHttpServletResponsefrom aBindingsmap.- Parameters:
bindings- the bindings maps- Returns:
- the
SlingHttpServletResponseif 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
-