org.springframework.security.access.expression.method
Interface MethodSecurityExpressionHandler

All Known Implementing Classes:
DefaultMethodSecurityExpressionHandler

public interface MethodSecurityExpressionHandler

Facade which isolates Spring Security's requirements for evaluation method-security expressions from the implementation of the underlying expression objects.

Since:
3.0
Version:
$Id: MethodSecurityExpressionHandler.java 3650 2009-05-11 05:18:20Z ltaylor $
Author:
Luke Taylor

Method Summary
 EvaluationContext createEvaluationContext(Authentication authentication, org.aopalliance.intercept.MethodInvocation mi)
          Provides an evaluation context in which to evaluate security expressions for a method invocation.
 Object filter(Object filterTarget, Expression filterExpression, EvaluationContext ctx)
          Filters a target collection or array.
 ExpressionParser getExpressionParser()
           
 void setReturnObject(Object returnObject, EvaluationContext ctx)
          Used to inform the expression system of the return object for the given evaluation context.
 

Method Detail

getExpressionParser

ExpressionParser getExpressionParser()
Returns:
an expression parser for the expressions used by the implementation.

createEvaluationContext

EvaluationContext createEvaluationContext(Authentication authentication,
                                          org.aopalliance.intercept.MethodInvocation mi)
Provides an evaluation context in which to evaluate security expressions for a method invocation.


filter

Object filter(Object filterTarget,
              Expression filterExpression,
              EvaluationContext ctx)
Filters a target collection or array. Only applies to method invocations.

Parameters:
filterTarget - the array or collection to be filtered.
filterExpression - the expression which should be used as the filter condition. If it returns false on evaluation, the object will be removed from the returned collection
ctx - the current evaluation context (as created through a call to createEvaluationContext(Authentication, MethodInvocation)
Returns:
the filtered collection or array

setReturnObject

void setReturnObject(Object returnObject,
                     EvaluationContext ctx)
Used to inform the expression system of the return object for the given evaluation context. Only applies to method invocations.

Parameters:
returnObject - the return object value
ctx - the context within which the object should be set (as created through a call to createEvaluationContext(Authentication, MethodInvocation)


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.