Class ExtensionUtils
java.lang.Object
org.apache.sling.scripting.sightly.impl.engine.extension.ExtensionUtils
Helper class for
RuntimeExtension
implementations.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkArgumentCount
(String extensionName, Object[] arguments, int count) Helper method for checking if the number of arguments passed to aRuntimeExtension
are equal to what the extension requires.setRequestAttributes
(SlingHttpServletRequest request, Map<String, Object> newRequestAttributes) Helper method for setting specific attributes in aSlingHttpServletRequest
scope
-
Constructor Details
-
ExtensionUtils
public ExtensionUtils()
-
-
Method Details
-
checkArgumentCount
Helper method for checking if the number of arguments passed to aRuntimeExtension
are equal to what the extension requires.- Parameters:
extensionName
- the name of the extensionarguments
- the arguments arraycount
- the expected number or arguments- Throws:
SightlyException
- if the number of supplied arguments differs from what's expected
-
setRequestAttributes
public static Map<String,Object> setRequestAttributes(SlingHttpServletRequest request, Map<String, Object> newRequestAttributes) Helper method for setting specific attributes in aSlingHttpServletRequest
scope- Parameters:
request
- theSlingHttpServletRequest
newRequestAttributes
- theMap
of attributes to set- Returns:
- A
Map
of original attributes values for substituted keys
-