org.x4juli.global.spi.location
Class StackTraceElementExtractor

java.lang.Object
  extended byorg.x4juli.global.spi.location.StackTraceElementExtractor

public class StackTraceElementExtractor
extends java.lang.Object

A faster extractor based on StackTraceElements introduced in JDK 1.4. The present code uses reflection. Thus, it should compile on all platforms.

Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Martin Schulz, Ceki Gülcü. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

This is just a plain copy.

Since:
0.5
Author:
Martin Schulz, Ceki Gülcü

Field Summary
private static java.lang.reflect.Method getClassName
           
private static java.lang.reflect.Method getFileName
           
private static java.lang.reflect.Method getLineNumber
           
private static java.lang.reflect.Method getMethodName
           
private static java.lang.reflect.Method getStackTrace
           
private static java.lang.Object[] nullArgs
           
 
Constructor Summary
StackTraceElementExtractor()
           
 
Method Summary
(package private) static void extract(LocationInfo li, java.lang.Throwable t, java.lang.String fqnOfInvokingClass)
           
(package private) static void setClassName(LocationInfo li, java.lang.Object location)
          Return the fully qualified class name of the caller making the logging request.
(package private) static void setFileName(LocationInfo li, java.lang.Object location)
           
(package private) static void setLineNumber(LocationInfo li, java.lang.Object location)
           
(package private) static void setMethodName(LocationInfo li, java.lang.Object location)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getStackTrace

private static java.lang.reflect.Method getStackTrace

getClassName

private static java.lang.reflect.Method getClassName

getFileName

private static java.lang.reflect.Method getFileName

getMethodName

private static java.lang.reflect.Method getMethodName

getLineNumber

private static java.lang.reflect.Method getLineNumber

nullArgs

private static java.lang.Object[] nullArgs
Constructor Detail

StackTraceElementExtractor

public StackTraceElementExtractor()
Method Detail

extract

static void extract(LocationInfo li,
                    java.lang.Throwable t,
                    java.lang.String fqnOfInvokingClass)

setClassName

static void setClassName(LocationInfo li,
                         java.lang.Object location)
Return the fully qualified class name of the caller making the logging request.


setFileName

static void setFileName(LocationInfo li,
                        java.lang.Object location)

setLineNumber

static void setLineNumber(LocationInfo li,
                          java.lang.Object location)

setMethodName

static void setMethodName(LocationInfo li,
                          java.lang.Object location)


${license_html}