S
- the script interfacepublic abstract class AbstractScriptException<S> extends java.lang.Object implements ScriptException<S>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
message
The exception message.
|
protected ScriptWrapper<S> |
script
The script wrapper.
|
protected java.util.List<java.lang.StackTraceElement> |
stackTrace
The StackTrace.
|
COMPILATION_EXCEPTION, RUNTIME_EXCEPTION
Constructor and Description |
---|
AbstractScriptException(ScriptWrapper<S> script,
short exceptionType,
java.lang.Throwable throwable,
java.lang.String message,
int lineNumber)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addToStrackTrace(int line,
java.lang.String fileName,
java.lang.StackTraceElement st)
Add a StackTraceElement to the StackTrace
|
short |
getExceptionType()
Return the exception type.
|
java.lang.String |
getFilename()
Return the script filename.
|
int |
getLineNumber()
Return the exception line number.
|
int |
getLineNumber(int lineNumber)
Return the effective line number of a line detected in the script runtime.
|
java.lang.String |
getMessage()
Return the exception message.
|
ScriptWrapper<S> |
getScript()
Return the script wrapper.
|
ScriptSource |
getSource()
Return the script source.
|
java.util.List<java.lang.StackTraceElement> |
getStackTrace(boolean filterScriptExceptions)
Return the StackTrace.
|
java.lang.Throwable |
getThrowable()
Return the wrapped Java exception.
|
protected abstract void |
populateStackTrace(boolean filterScriptExceptions)
Populate the StackTrace.
|
void |
setFileName(java.lang.String filename)
Set the exception file name.
|
void |
setScript(ScriptWrapper<S> script)
Set the script wrapper.
|
protected ScriptWrapper<S> script
protected java.lang.String message
protected java.util.List<java.lang.StackTraceElement> stackTrace
public AbstractScriptException(ScriptWrapper<S> script, short exceptionType, java.lang.Throwable throwable, java.lang.String message, int lineNumber)
script
- exceptionType
- throwable
- message
- lineNumber
- public void setFileName(java.lang.String filename)
filename
- the file namepublic short getExceptionType()
ScriptException.RUNTIME_EXCEPTION
or ScriptException.COMPILATION_EXCEPTION
.getExceptionType
in interface ScriptException<S>
protected void addToStrackTrace(int line, java.lang.String fileName, java.lang.StackTraceElement st)
line
- the line numberfileName
- the Script file namest
- the wrapped StackTraceElementpublic java.util.List<java.lang.StackTraceElement> getStackTrace(boolean filterScriptExceptions)
getStackTrace
in interface ScriptException<S>
filterScriptExceptions
- filter the script exceptions, if true only those exceptions will be added in
the StackTracepublic ScriptSource getSource()
getSource
in interface ScriptException<S>
public java.lang.String getFilename()
getFilename
in interface ScriptException<S>
public int getLineNumber(int lineNumber)
getLineNumber
in interface ScriptException<S>
lineNumber
- the line numberpublic int getLineNumber()
getLineNumber
in interface ScriptException<S>
public void setScript(ScriptWrapper<S> script)
setScript
in interface ScriptException<S>
script
- the script wrapperpublic ScriptWrapper<S> getScript()
getScript
in interface ScriptException<S>
public java.lang.String getMessage()
getMessage
in interface ScriptException<S>
public java.lang.Throwable getThrowable()
getThrowable
in interface ScriptException<S>
protected abstract void populateStackTrace(boolean filterScriptExceptions)
filterScriptExceptions
- filter the script exceptions, if true only those exceptions will be added in
the StackTraceCopyright © 2019-2024 Herve Girod. All Rights Reserved. Documentation and source under the BSD licence