SecurityBuilder
是Spring Security Config
对安全构建器的概念建模接口,该接口约定了Spring Security Config
的各种安全构建器实现类的统一行为:
- 执行构建调用
#build()
方法;
这是一个泛型接口,泛型参数O
表示目标构建对象的类型(O
可以理解成是Output
的缩写)。
源代码
源代码版本 : Spring Security Config 5.1.4.RELEASE
package org.springframework.security.config.annotation;
/**
* Interface for building an Object
*
* @author Rob Winch
* @since 3.2
*
* @param <O> The type of the Object being built
*/
public interface SecurityBuilder<O> {
/**
* Builds the object and returns it or null.
*
* @return the Object to be built or null if the implementation allows it.
* @throws Exception if an error occurred when building the Object
*/
O build() throws Exception;
}