ch.qos.logback.classic.spi
Class CallerData

java.lang.Object
  extended by ch.qos.logback.classic.spi.CallerData
All Implemented Interfaces:
java.io.Serializable

public class CallerData
extends java.lang.Object
implements java.io.Serializable

The internal representation of caller location information.

Author:
Ceki Gülcü
See Also:
Serialized Form

Field Summary
static java.lang.String CALLER_DATA_NA
           
static CallerData[] EMPTY_CALLER_DATA_ARRAY
          This value is returned in case no caller data could be extracted.
static int LINE_NA
          When caller information is not available this constant is used for the line number.
static java.lang.String NA
          When caller information is not available this constant is used for file name, method name, etc.
 
Constructor Summary
CallerData(java.lang.StackTraceElement ste)
           
CallerData(java.lang.String fileName, java.lang.String className, java.lang.String methodName, int lineNumber)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
static CallerData[] extract(java.lang.Throwable t, java.lang.String fqnOfInvokingClass)
          Extract caller data information as an array based on a Throwable passed as parameter
 java.lang.String getClassName()
          Return the fully qualified class name of the caller making the logging request.
 java.lang.String getFileName()
          Return the file name of the caller.
 int getLineNumber()
          Returns the line number of the caller.
 java.lang.String getMethodName()
          Returns the method name of the caller.
static boolean isDirectlyInvokingClass(java.lang.String currentClass, java.lang.String fqnOfInvokingClass)
           
 boolean isNativeMethod()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NA

public static final java.lang.String NA
When caller information is not available this constant is used for file name, method name, etc.

See Also:
Constant Field Values

LINE_NA

public static final int LINE_NA
When caller information is not available this constant is used for the line number.

See Also:
Constant Field Values

CALLER_DATA_NA

public static java.lang.String CALLER_DATA_NA

EMPTY_CALLER_DATA_ARRAY

public static CallerData[] EMPTY_CALLER_DATA_ARRAY
This value is returned in case no caller data could be extracted.

Constructor Detail

CallerData

public CallerData(java.lang.String fileName,
                  java.lang.String className,
                  java.lang.String methodName,
                  int lineNumber)

CallerData

public CallerData(java.lang.StackTraceElement ste)
Method Detail

extract

public static CallerData[] extract(java.lang.Throwable t,
                                   java.lang.String fqnOfInvokingClass)
Extract caller data information as an array based on a Throwable passed as parameter


isDirectlyInvokingClass

public static boolean isDirectlyInvokingClass(java.lang.String currentClass,
                                              java.lang.String fqnOfInvokingClass)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getClassName

public java.lang.String getClassName()
Return the fully qualified class name of the caller making the logging request.


getFileName

public java.lang.String getFileName()
Return the file name of the caller.

This information is not always available.


getLineNumber

public int getLineNumber()
Returns the line number of the caller.

This information is not always available.


getMethodName

public java.lang.String getMethodName()
Returns the method name of the caller.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isNativeMethod

public boolean isNativeMethod()