Class SecurityPolicy.Builder
java.lang.Object
cloud.opencode.base.expression.sandbox.SecurityPolicy.Builder
- Enclosing class:
SecurityPolicy
Builder for SecurityPolicy
SecurityPolicy 构建器
- Since:
- JDK 25, opencode-base-expression V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowClass(Class<?>... classes) Allow a class 允许一个类allowFunction(String... functions) Allow a function 允许一个函数allowMethod(String... methods) Allow a method 允许一个方法build()Build the policy 构建策略Deny a class 拒绝一个类denyFunction(String... functions) Deny a function 拒绝一个函数denyMethod(String... methods) Deny a method 拒绝一个方法maxExpressionLength(int max) Set max expression length 设置最大表达式长度maxIterations(int max) Set max iterations 设置最大迭代次数timeout(long millis) Set timeout 设置超时
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowClass
Allow a class 允许一个类- Parameters:
classes- the classes | 类- Returns:
- this builder | 此构建器
-
denyClass
Deny a class 拒绝一个类- Parameters:
classNames- the class names | 类名- Returns:
- this builder | 此构建器
-
allowMethod
Allow a method 允许一个方法- Parameters:
methods- the method names | 方法名- Returns:
- this builder | 此构建器
-
denyMethod
Deny a method 拒绝一个方法- Parameters:
methods- the method names | 方法名- Returns:
- this builder | 此构建器
-
allowFunction
Allow a function 允许一个函数- Parameters:
functions- the function names | 函数名- Returns:
- this builder | 此构建器
-
denyFunction
Deny a function 拒绝一个函数- Parameters:
functions- the function names | 函数名- Returns:
- this builder | 此构建器
-
timeout
Set timeout 设置超时- Parameters:
millis- the timeout in milliseconds | 超时毫秒数- Returns:
- this builder | 此构建器
-
maxIterations
Set max iterations 设置最大迭代次数- Parameters:
max- the max iterations | 最大迭代次数- Returns:
- this builder | 此构建器
-
maxExpressionLength
Set max expression length 设置最大表达式长度- Parameters:
max- the max length | 最大长度- Returns:
- this builder | 此构建器
-
build
-