Groovy Documentation

org.codehaus.groovy.grails.exceptions
[Groovy] Class DefaultStackTracePrinter

java.lang.Object
  org.codehaus.groovy.grails.exceptions.DefaultStackTracePrinter
All Implemented Interfaces:
StackTracePrinter

class DefaultStackTracePrinter
extends java.lang.Object

Default implementation of the StackTracePrinter interface.

Authors:
Graeme Rocher
Marc Palmer
Since:
2.0


Property Summary
ResourceLocator resourceLocator

 
Constructor Summary
DefaultStackTracePrinter()

DefaultStackTracePrinter(ResourceLocator resourceLocator)

 
Method Summary
java.lang.String formatCodeSnippetEnd(org.springframework.core.io.Resource resource, int lineNumber)

protected java.lang.String formatCodeSnippetErrorLine(int currentLineNumber, java.lang.Object currentLine)

protected java.lang.String formatCodeSnippetLine(int currentLineNumber, java.lang.Object currentLine)

java.lang.String formatCodeSnippetStart(org.springframework.core.io.Resource resource, int lineNumber)

protected java.lang.String getFileName(java.lang.StackTraceElement te)

protected org.springframework.core.io.Resource getFileNameInfo(java.lang.Throwable cause, org.springframework.core.io.Resource res)

protected int getLineNumberInfo(java.lang.Throwable cause, int defaultInfo)

protected java.lang.Throwable getRootCause(java.lang.Throwable ex)

Obtains the root cause of the given exception

static java.lang.String makeRelativeIfPossible(java.lang.String fileName)

java.lang.String prettyPrint(java.lang.Throwable t)

java.lang.String prettyPrintCodeSnippet(java.lang.Throwable exception)

protected java.lang.Object printCausedByMessage(java.io.PrintWriter sb, java.lang.Throwable e)

protected java.lang.Object printFailureLocation(java.io.PrintWriter sb, java.lang.String lineNumber, java.lang.String methodName, java.lang.String fileName)

protected java.lang.Object printHeader(java.io.PrintWriter sb, java.lang.String header)

protected java.lang.Object printLastEntry(java.io.PrintWriter sb, java.lang.String lineNumber, java.lang.String methodName, java.lang.String fileName)

protected java.lang.Object printStackLine(java.io.PrintWriter sb, java.lang.String lineNumber, java.lang.String methodName, java.lang.String fileName)

protected boolean shouldSkipNextCause(java.lang.Throwable e)

 
Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()
 

Property Detail

resourceLocator

ResourceLocator resourceLocator


 
Constructor Detail

DefaultStackTracePrinter

DefaultStackTracePrinter()


DefaultStackTracePrinter

DefaultStackTracePrinter(ResourceLocator resourceLocator)


 
Method Detail

formatCodeSnippetEnd

java.lang.String formatCodeSnippetEnd(org.springframework.core.io.Resource resource, int lineNumber)


formatCodeSnippetErrorLine

protected java.lang.String formatCodeSnippetErrorLine(int currentLineNumber, java.lang.Object currentLine)


formatCodeSnippetLine

protected java.lang.String formatCodeSnippetLine(int currentLineNumber, java.lang.Object currentLine)


formatCodeSnippetStart

java.lang.String formatCodeSnippetStart(org.springframework.core.io.Resource resource, int lineNumber)


getFileName

protected java.lang.String getFileName(java.lang.StackTraceElement te)


getFileNameInfo

protected org.springframework.core.io.Resource getFileNameInfo(java.lang.Throwable cause, org.springframework.core.io.Resource res)


getLineNumberInfo

protected int getLineNumberInfo(java.lang.Throwable cause, int defaultInfo)


getRootCause

protected java.lang.Throwable getRootCause(java.lang.Throwable ex)
Obtains the root cause of the given exception
Parameters:
ex - The exception
Returns:
The root cause


makeRelativeIfPossible

static java.lang.String makeRelativeIfPossible(java.lang.String fileName)


prettyPrint

java.lang.String prettyPrint(java.lang.Throwable t)


prettyPrintCodeSnippet

java.lang.String prettyPrintCodeSnippet(java.lang.Throwable exception)


printCausedByMessage

protected java.lang.Object printCausedByMessage(java.io.PrintWriter sb, java.lang.Throwable e)


printFailureLocation

protected java.lang.Object printFailureLocation(java.io.PrintWriter sb, java.lang.String lineNumber, java.lang.String methodName, java.lang.String fileName)


printHeader

protected java.lang.Object printHeader(java.io.PrintWriter sb, java.lang.String header)


printLastEntry

protected java.lang.Object printLastEntry(java.io.PrintWriter sb, java.lang.String lineNumber, java.lang.String methodName, java.lang.String fileName)


printStackLine

protected java.lang.Object printStackLine(java.io.PrintWriter sb, java.lang.String lineNumber, java.lang.String methodName, java.lang.String fileName)


shouldSkipNextCause

protected boolean shouldSkipNextCause(java.lang.Throwable e)


 

Groovy Documentation