class ScopeVariableResolverFactory extends
        ReadOnlyVariableResolverFactory {

    public boolean isTarget(String name) {
        Request request = requestHolder.getTilesRequestContext();
        if (name.endsWith("Scope")) {
            String scopeName = name.substring(0, name.length() - SCOPE_SUFFIX_LENGTH);
            for (String availableScope : request.getAvailableScopes()) {
                if (scopeName.equals(availableScope)) {
                    return true;
                }
            }
        }
        return false;
    }

    public  ScopeVariableResolverFactory(TilesRequestContextHolder requestHolder);

}