站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

StackTrace.Parser (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


org.jboss.util
Class StackTrace.Parser

java.lang.Object
  extended byorg.jboss.util.StackTrace.Parser
Enclosing class:
StackTrace

public static class StackTrace.Parser
extends Object

A parser which takes a standard Throwable and produces StackTrace.Entry objects.


Constructor Summary
StackTrace.Parser()
           
 
Method Summary
protected  StackTrace.Entry createEntry(String raw)
          Create a stack trace entry for the given raw trace entry.
protected  BufferedReader createReader(Throwable detail)
          Create a reader for the trace of the given Throwable.
static StackTrace.Parser getInstance()
          Get the stack trace parser for this virtual machine.
 List parse(Throwable detail, int level, int limit)
          Parse a Throwable stack trace.
protected  byte[] readBytes(Throwable detail)
          Read a throwable stack trace as an array of bytes.
protected  void setLevel(BufferedReader reader, int level)
          Skip to the correct level of the stack (going down into the stack).
protected  void skipDescription(BufferedReader reader)
          Skip the throwable description of the trace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StackTrace.Parser

public StackTrace.Parser()
Method Detail

skipDescription

protected void skipDescription(BufferedReader reader)
                        throws IOException
Skip the throwable description of the trace.

Parameters:
reader - Reader representing the trace.
Throws:
IOException

setLevel

protected void setLevel(BufferedReader reader,
                        int level)
                 throws IOException
Skip to the correct level of the stack (going down into the stack).

Parameters:
reader - Reader representing the stack trace.
level - Number of levels to go down.
Throws:
IOException

readBytes

protected byte[] readBytes(Throwable detail)
                    throws IOException
Read a throwable stack trace as an array of bytes.

Parameters:
detail - Throwable to get trace from.
Returns:
Throwable stack trace as an array of bytes.
Throws:
IOException

createReader

protected BufferedReader createReader(Throwable detail)
                               throws IOException
Create a reader for the trace of the given Throwable.

Parameters:
detail - Thorwable to get trace from.
Returns:
Reader for the throwable stack trace.
Throws:
IOException

parse

public List parse(Throwable detail,
                  int level,
                  int limit)
           throws IOException
Parse a Throwable stack trace.

Parameters:
detail - Throwable to get trace from.
level - Number of levels down to begin parsing.
limit - The maximum number of entries to parse (does not include skipped levels or the description). A value <= zero results in all entries being parsed.
Returns:
List of StackTrace.Entry objects.
Throws:
IOException

createEntry

protected StackTrace.Entry createEntry(String raw)
                                throws IOException
Create a stack trace entry for the given raw trace entry.

Parameters:
raw - Raw stack trace entry.
Returns:
Stack trace entry.
Throws:
IOException

getInstance

public static final StackTrace.Parser getInstance()
                                           throws InstantiationException
Get the stack trace parser for this virtual machine.

Returns:
Stack trace parser
Throws:
InstantiationException


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.