Class SafeConstructor.DefaultSafeConstructor

java.lang.Object
cloud.opencode.base.yml.security.SafeConstructor.DefaultSafeConstructor
All Implemented Interfaces:
SafeConstructor
Enclosing interface:
SafeConstructor

public static final class SafeConstructor.DefaultSafeConstructor extends Object implements SafeConstructor
Default Safe Constructor Implementation 默认安全构造器实现
Since:
JDK 25, opencode-base-yml V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • isSafeType

      public boolean isSafeType(Class<?> type)
      Description copied from interface: SafeConstructor
      Checks if a type is safe for construction. 检查类型是否可以安全构造。
      Specified by:
      isSafeType in interface SafeConstructor
      Parameters:
      type - the type to check | 要检查的类型
      Returns:
      true if safe | 如果安全则返回 true
    • isSafeType

      public boolean isSafeType(String typeName)
      Description copied from interface: SafeConstructor
      Checks if a type name is safe for construction. 检查类型名称是否可以安全构造。
      Specified by:
      isSafeType in interface SafeConstructor
      Parameters:
      typeName - the type name | 类型名称
      Returns:
      true if safe | 如果安全则返回 true
    • getAllowedTypes

      public Set<Class<?>> getAllowedTypes()
      Description copied from interface: SafeConstructor
      Gets the set of allowed types. 获取允许的类型集合。
      Specified by:
      getAllowedTypes in interface SafeConstructor
      Returns:
      allowed types | 允许的类型
    • getAllowedPackages

      public Set<String> getAllowedPackages()
      Description copied from interface: SafeConstructor
      Gets the set of allowed packages. 获取允许的包名集合。
      Specified by:
      getAllowedPackages in interface SafeConstructor
      Returns:
      allowed packages | 允许的包名