Class org.as2lib.env.except.StackTraceElement

org.as2lib.core.BasicClass
   +--org.as2lib.env.except.StackTraceElement

Description

StackTraceElement represents an element in the stack trace returned by the Throwable#getStackTrace method.

A stack trace element is simply a data holder. It holds the thrower, the method that threw the throwable and the arguments passed to the method that threw the throwable.

This class is also responsible for stringifying itself. This functionality is used by the ThrowableStringifier. You can set your own stringifier to get a custom string representation of the stack trace element via the static method.

Method Index

new StackTraceElement()

getArguments(), getMethod(), getStringifier(), getThrower(), setStringifier(), toString()

Constructor Detail

StackTraceElement

public function StackTraceElement(thrower, method:Function, args:Array)

Constructs a new SimpleStackTraceElement instance.

Parameters

throwerthe object that declares the method that threw the throwable
methodthe method that threw the throwable
argsthe arguments passed to the throwing method

Method Detail

getStringifier

static public function getStringifier(Void):Stringifier

Returns the stringifier to stringify stack trace elements.

The returned stringifier is either the default StackTraceElementStringifier if no custom stringifier was set or if the stringifier was set to null or the set stringifier.

Return

the default or the custom stringifier

setStringifier

static public function setStringifier(stackTraceElementStringifier:Stringifier):Void

Sets the stringifier to stringify stack trace elements.

If stackTraceElementStringifier is null the static getStringifier method returns the default stringifier.

Parameters

stackTraceElementStringifierthe stringifier to stringify stack trace elements

getThrower

public function getThrower(Void)

Returns the object that declares the method that threw the throwable.

Return

the object that declares the method that threw the throwable

getMethod

public function getMethod(Void):Function

Returns the method that threw the throwable.

Return

the method that threw the throwable

getArguments

public function getArguments(Void):Array

Returns the arguments that have been passed to the method that threw the throwable.

Return

the arguments passed to the method that threw the throwable

toString

public function toString():String

Returns the string representation of this stack trace element.

The string representation is obtained via the stringifier returned by the static getStringifier method.

Return

the string representation of this stack trace element

Specified By

toString() in org.as2lib.core.BasicInterface

Overrides

toString() in org.as2lib.core.BasicClass