Package org.springframework.security.authorization.method

# Interface AuthorizationAdvisorProxyFactory.TargetVisitor

Enclosing class:
  AuthorizationAdvisorProxyFactory

public static interface AuthorizationAdvisorProxyFactory.TargetVisitor
An interface to handle how the `AuthorizationAdvisorProxyFactory` should step through the target's object hierarchy.

Since:
  6.3
See Also:
  - `AuthorizationAdvisorProxyFactory.setTargetVisitor(org.springframework.security.authorization.method.AuthorizationAdvisorProxyFactory.TargetVisitor)`

## Method Summary

Modifier and Type
Method
Description
`static AuthorizationAdvisorProxyFactory.TargetVisitor`
`defaults()`
The default `AuthorizationAdvisorProxyFactory.TargetVisitor`, which will proxy `Class` instances as well as instances contained in reactive types (if reactor is present), collection types, and other container types like `Optional` and `Supplier`
`static AuthorizationAdvisorProxyFactory.TargetVisitor`
`defaultsSkipValueTypes()`
The default `AuthorizationAdvisorProxyFactory.TargetVisitor` that also skips any value types (for example, `String`, `Integer`).
`static AuthorizationAdvisorProxyFactory.TargetVisitor`
`of(AuthorizationAdvisorProxyFactory.TargetVisitor... visitors)`
Compose a set of visitors.
`Object`
`visit(AuthorizationAdvisorProxyFactory proxyFactory, Object target)`
Visit and possibly proxy this object.

## Method Details

### visit

Object visit(AuthorizationAdvisorProxyFactory proxyFactory, Object target)
Visit and possibly proxy this object.

Visiting may take the form of walking down this object's hierarchy and proxying sub-objects.

An example is a visitor that proxies the elements of a `List` instead of the list itself

Returning `null` implies that this visitor does not want to proxy this object

Parameters:
  `proxyFactory` - the proxy factory to delegate proxying to for any sub-objects
  `target` - the object to proxy
Returns:
  the visited (and possibly proxied) object

### defaults

static AuthorizationAdvisorProxyFactory.TargetVisitor defaults()
The default `AuthorizationAdvisorProxyFactory.TargetVisitor`, which will proxy `Class` instances as well as instances contained in reactive types (if reactor is present), collection types, and other container types like `Optional` and `Supplier`

### defaultsSkipValueTypes

static AuthorizationAdvisorProxyFactory.TargetVisitor defaultsSkipValueTypes()
The default `AuthorizationAdvisorProxyFactory.TargetVisitor` that also skips any value types (for example, `String`, `Integer`). This is handy for annotations like `AuthorizeReturnObject` when used at the class level

### of

static AuthorizationAdvisorProxyFactory.TargetVisitor of(AuthorizationAdvisorProxyFactory.TargetVisitor... visitors)
Compose a set of visitors. This is helpful when you are customizing for a given type and still want the defaults applied for the remaining types.

The resulting visitor will execute the first visitor that returns a non-null value.

Parameters:
  `visitors` - the set of visitors
Returns:
  a composite that executes the first visitor that returns a non-null value