Class SandboxViolation
java.lang.Object
org.codehaus.commons.compiler.sandbox.SandboxViolation
- All Implemented Interfaces:
Serializable
A reason why a
BytecodeVerifier rejected a class.
If the class file contains line numbers (i.e. it was compiled with debugging information), then a violation that
concerns the use of a field, method or constructor carries the source line where it is used, see getLocation().
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioninttoString()withLocation(String fileName, int lineNumber) Returns a copy of this violation with the given file name and line number.
-
Method Details
-
getClassName
- Returns:
- The name of the rejected class, e.g.
"pkg.Foo$1"
-
getMessage
- Returns:
- A human-readable description of the violation, e.g.
"Access to java.lang.System.getProperty(java.lang.String) is not permitted by the sandbox policy"
-
getFileName
-
getLineNumber
public int getLineNumber()- Returns:
- The source line where the violating field, method or constructor is used, or -1 iff unknown (e.g. because the class file contains no line numbers, or because the violation concerns the class as a whole, like a forbidden superclass)
-
getLocation
-
withLocation
Returns a copy of this violation with the given file name and line number. Compilers use this to map the locations in the generated code to the locations in the document that they compiled. -
toString
-