class ScopePropertyAccessor implements PropertyAccessor {

    @Override
    public String getSourceAccessor(OgnlContext context, Object target,
            Object index) {
        String scope = (String) index;
        if (scope.endsWith("Scope")) {
            String scopeName = scope.substring(0, scope.length() - SCOPE_SUFFIX_LENGTH);
            return ".getContext(\"" + scopeName + "\")";
        }
        return null;
    }

}