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
-
Method Summary
Modifier and TypeMethodDescriptionstatic SlingScriptHelper
Retrieves theSlingScriptHelper
from aBindings
map.static SlingHttpServletRequest
getRequest
(Bindings bindings) Retrieves theSlingHttpServletRequest
from aBindings
map.static Resource
getResource
(Bindings bindings) static SlingHttpServletResponse
getResponse
(Bindings bindings) Retrieves theSlingHttpServletResponse
from aBindings
map.static Bindings
Combine two bindings objects.
-
Constructor Details
-
BindingsUtils
public BindingsUtils()
-
-
Method Details
-
getResource
- Parameters:
bindings
- the bindings map- Returns:
- the
Resource
if found,null
otherwise
-
getRequest
Retrieves theSlingHttpServletRequest
from aBindings
map.- Parameters:
bindings
- the bindings maps- Returns:
- the
SlingHttpServletRequest
if found,null
otherwise
-
getResponse
Retrieves theSlingHttpServletResponse
from aBindings
map.- Parameters:
bindings
- the bindings maps- Returns:
- the
SlingHttpServletResponse
if found,null
otherwise
-
getHelper
Retrieves theSlingScriptHelper
from aBindings
map.- Parameters:
bindings
- the bindings map- Returns:
- the
SlingScriptHelper
if found,null
otherwise
-
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
-