Interface BytecodeVerifier

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface BytecodeVerifier
Functional interface for custom bytecode verification 自定义字节码验证的函数式接口

Implementations inspect raw class bytecode and determine whether it should be allowed to load. This can be used to enforce security policies such as banning specific opcodes, enforcing size limits, or running static analysis.

实现检查原始类字节码并确定是否允许加载。可用于执行安全策略, 如禁止特定操作码、强制大小限制或运行静态分析。

Security | 安全性:

  • Thread-safe: Implementation-dependent - 线程安全: 取决于实现
Since:
JDK 25, opencode-base-classloader V1.0.3
Author:
Leon Soo www.LeonSoo.com
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    verify(byte[] bytecode)
    Verify whether the given bytecode should be allowed to load 验证给定的字节码是否应被允许加载
  • Method Details

    • verify

      boolean verify(byte[] bytecode)
      Verify whether the given bytecode should be allowed to load 验证给定的字节码是否应被允许加载
      Parameters:
      bytecode - the raw class bytecode to verify | 要验证的原始类字节码
      Returns:
      true if the bytecode passes verification, false otherwise | 如果字节码通过验证返回 true,否则返回 false