Code example for SimpleBindings

0
 * Utilities for script evaluation 
 */ 
public class Utils { 
    private static final String EXTENSION = "js";
 
    public static final Bindings EMPTY_BINDINGS = new SimpleBindings(Collections.<String, Object>emptyMap());
 
    public static SlingScriptHelper getHelper(Bindings bindings) {
        return (SlingScriptHelper) bindings.get(SlingBindings.SLING);
    } 
 
    public static boolean isJsScript(String identifier) {
        String extension = StringUtils.substringAfterLast(identifier, ".");
        return EXTENSION.equalsIgnoreCase(extension);
    } 
 
}