Class SandboxViolationException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.codehaus.commons.compiler.sandbox.SandboxViolationException
- All Implemented Interfaces:
Serializable
Indicates that one or more classes were rejected by a
BytecodeVerifier.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringmessage(List<SandboxViolation> violations) toCompileException(ErrorHandler compileErrorHandler) Reports the violations through the compileErrorHandler (if any), one by one, and returns aCompileExceptionfor the caller to throw, with this exception as its cause.Methods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
SandboxViolationException
- Parameters:
violations- Must not be empty
-
-
Method Details
-
getViolations
-
toCompileException
public CompileException toCompileException(@Nullable ErrorHandler compileErrorHandler) throws CompileException Reports the violations through the compileErrorHandler (if any), one by one, and returns aCompileExceptionfor 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
- Returns:
- A message that lists all violations, one per line
-