org.aspectj.weaver.tools

Class AbstractTrace

Implemented Interfaces:
Trace
Known Direct Subclasses:
CommonsTrace, DefaultTrace

public abstract class AbstractTrace
extends java.lang.Object
implements Trace

Copyright (c) 2006 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Matthew Webster - initial implementation

Field Summary

protected Class
tracedClass

Constructor Summary

AbstractTrace(Class clazz)

Method Summary

void
enter(String methodName)
abstract void
enter(String methodName, Object thiz)
void
enter(String methodName, Object thiz, Object arg)
abstract void
enter(String methodName, Object thiz, Object[] args)
void
enter(String methodName, Object thiz, boolean z)
void
error(String message)
void
event(String methodName, Object thiz, Object arg)
abstract void
exit(String methodName, Object ret)
abstract void
exit(String methodName, Throwable th)
void
exit(String methodName, boolean b)
void
exit(String methodName, int i)
void
fatal(String message)
protected String
formatArgs(Object[] args)
Format arguments into a comma separated list
protected String
formatArray(Object obj)
protected String
formatCollection(Collection c)
protected String
formatMessage(String kind, String className, String methodName, Object thiz, Object[] args)
protected String
formatMessage(String kind, String text, Throwable th)
protected Object
formatObj(Object obj)
Format objects safely avoiding toString which can cause recursion, NullPointerExceptions or highly verbose results.
protected Object[]
formatObjects(Object[] args)
void
warn(String message)

Field Details

tracedClass

protected Class tracedClass

Constructor Details

AbstractTrace

protected AbstractTrace(Class clazz)

Method Details

enter

public void enter(String methodName)

enter

public abstract void enter(String methodName,
                           Object thiz)
Specified by:
enter in interface Trace

enter

public void enter(String methodName,
                  Object thiz,
                  Object arg)
Specified by:
enter in interface Trace

enter

public abstract void enter(String methodName,
                           Object thiz,
                           Object[] args)
Specified by:
enter in interface Trace

enter

public void enter(String methodName,
                  Object thiz,
                  boolean z)
Specified by:
enter in interface Trace

error

public void error(String message)
Specified by:
error in interface Trace

event

public void event(String methodName,
                  Object thiz,
                  Object arg)
Specified by:
event in interface Trace

exit

public abstract void exit(String methodName,
                          Object ret)
Specified by:
exit in interface Trace

exit

public abstract void exit(String methodName,
                          Throwable th)
Specified by:
exit in interface Trace

exit

public void exit(String methodName,
                 boolean b)
Specified by:
exit in interface Trace

exit

public void exit(String methodName,
                 int i)
Specified by:
exit in interface Trace

fatal

public void fatal(String message)
Specified by:
fatal in interface Trace

formatArgs

protected String formatArgs(Object[] args)
Format arguments into a comma separated list
Parameters:
args - array of arguments
Returns:
the formated list

formatArray

protected String formatArray(Object obj)

formatCollection

protected String formatCollection(Collection c)

formatMessage

protected String formatMessage(String kind,
                               String className,
                               String methodName,
                               Object thiz,
                               Object[] args)

formatMessage

protected String formatMessage(String kind,
                               String text,
                               Throwable th)

formatObj

protected Object formatObj(Object obj)
Format objects safely avoiding toString which can cause recursion, NullPointerExceptions or highly verbose results.
Parameters:
obj - parameter to be formatted
Returns:
the formated parameter

formatObjects

protected Object[] formatObjects(Object[] args)

warn

public void warn(String message)
Specified by:
warn in interface Trace