public class StackTraceElement
extends java.lang.Object
This class represents one element in a stack trace. That can be a called function, a nestable block, an included file or an executed line.
Modifier and Type | Field and Description |
---|---|
private java.io.File |
file |
private java.lang.String |
functionName |
private int |
line |
private int |
lineBlockClose |
private int |
lineBlockOpen |
private int |
lineOffset |
private java.lang.String |
optionStr |
private java.lang.String |
paramStr |
private java.lang.String |
patternName |
Constructor and Description |
---|
StackTraceElement(java.io.File file,
int lineOffset)
Creates a new stack trace element.
|
Modifier and Type | Method and Description |
---|---|
void |
addToLine(int num)
Increments the current line number by the given value.
|
java.lang.String |
getTrace()
Constructs and returns a trace element string that can be included into the stack trace displayed to the user.
|
void |
incrementLine()
Increments the current line number by 1.
|
void |
resetLine()
Sets the current line number to the offset line.
|
void |
setFunctionName(java.lang.String name)
Sets the function name.
|
void |
setNestableBlock(int lineOpen,
int lineClose)
Sets opening and closing line number of the nestable block.
|
void |
setOptions(java.lang.String optionString)
Sets the option string.
|
void |
setParams(java.lang.String paramString)
Sets the parameter string.
|
void |
setPatternName(java.lang.String name)
Sets the pattern name.
|
java.lang.String |
toString()
Returns a short description of the trace element.
|
private java.lang.String functionName
private java.lang.String patternName
private java.lang.String paramStr
private java.lang.String optionStr
private java.io.File file
private int lineOffset
private int line
private int lineBlockOpen
private int lineBlockClose
public StackTraceElement(java.io.File file, int lineOffset)
Creates a new stack trace element.
file
- the file causing the new stack trace element.lineOffset
- the line causing (or line offset containing) the new stack trace element.public void setFunctionName(java.lang.String name)
Sets the function name. To be called only if the causing line is a function call.
name
- function namepublic void setPatternName(java.lang.String name)
Sets the pattern name. To be called only if the causing channel command uses a pattern.
name
- pattern namepublic void setParams(java.lang.String paramString)
Sets the parameter string. Only needed for function calls.
paramString
- the parameter string of the function call.public void setOptions(java.lang.String optionString)
Sets the option string. Needed for function calls or executions of nestable blocks.
optionString
- call or block option stringpublic void setNestableBlock(int lineOpen, int lineClose)
Sets opening and closing line number of the nestable block.
lineOpen
- line number of the block openinglineClose
- line number of the block closingpublic void resetLine()
Sets the current line number to the offset line. This is called from the constructor, and for block executions and function calls before each run, as often as the quantity option is specified.
public void incrementLine()
Increments the current line number by 1.
public void addToLine(int num)
Increments the current line number by the given value.
num
- value to be added to the current line number.public java.lang.String getTrace()
Constructs and returns a trace element string that can be included into the stack trace displayed to the user.
public java.lang.String toString()
Returns a short description of the trace element. Used for unit tests.
toString
in class java.lang.Object