Class SandboxViolationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.codehaus.commons.compiler.sandbox.SandboxViolationException
All Implemented Interfaces:
Serializable

public class SandboxViolationException extends RuntimeException
Indicates that one or more classes were rejected by a BytecodeVerifier.
See Also:
  • Constructor Details

    • SandboxViolationException

      public SandboxViolationException(List<SandboxViolation> violations)
      Parameters:
      violations - Must not be empty
  • Method Details

    • getViolations

      public List<SandboxViolation> getViolations()
    • toCompileException

      public CompileException toCompileException(@Nullable ErrorHandler compileErrorHandler) throws CompileException
      Reports the violations through the compileErrorHandler (if any), one by one, and returns a CompileException for the caller to throw, with this exception as its cause.

      The returned exception is located at the first violation that has a location. If there is exactly one violation, then the message of the exception is that of the violation; otherwise it lists all violations.

      Throws:
      CompileException - The compileErrorHandler threw it
    • message

      public static String message(List<SandboxViolation> violations)
      Returns:
      A message that lists all violations, one per line