net.sourceforge.acelogger.location
Class LogEventLocation

java.lang.Object
  extended by net.sourceforge.acelogger.location.LogEventLocation
All Implemented Interfaces:
Serializable

public class LogEventLocation
extends Object
implements Serializable

Stores location information for a log event.

Since:
1.0.0
Version:
1.0.0
Author:
Zardi (https://sourceforge.net/users/daniel_zardi)
See Also:
Serialized Form

Constructor Summary
LogEventLocation()
          Constructs a new LogEventLocation without any information.
LogEventLocation(Class<?> source)
          Constructs a new LogEventLocation for a given class.
LogEventLocation(Class<?> source, String methodName)
          Constructs a new LogEventLocation for a given method and class.
LogEventLocation(String packageName, String className)
          Constructs a new LogEventLocation for a given package and class.
LogEventLocation(String packageName, String className, String methodName)
          Constructs a new LogEventLocation for a given package, class and method.
LogEventLocation(String packageName, String className, String methodName, String fileName)
          Constructs a new LogEventLocation for a given package, class, method and file.
LogEventLocation(String packageName, String className, String methodName, String fileName, int lineNumber)
          Constructs a new LogEventLocation for a given package, class, method, file and line.
LogEventLocation(String packageName, String className, String methodName, String fileName, int lineNumber, String threadName)
          Constructs a new LogEventLocation for a given package, class, method, file, line and thread.
 
Method Summary
 String getClassName()
          Gets the caller class name.
 String getFileName()
          Gets the caller file name.
 String getFullQualifiedName()
          Gets the full qualified name of the callers class.
 String getJavadocLikeName()
          Gets a javadoc like name for the caller, this name resembles something like caller.package.SomeClass#aMethod.
 String getLineNumber()
          Gets the caller line number.
 String getMethodName()
          Gets the caller method name.
 String getPackageName()
          Gets the caller package name.
 String getStackTraceLikeName()
          Gets a string representing the file name and line number of the caller.
 String getThreadName()
          Gets the caller thread name.
 void setClassName(String className)
          Sets the caller class name.
 void setFileName(String fileName)
          Sets the caller file name.
 void setLineNumber(int lineNumber)
          Sets the caller line number.
 void setMethodName(String methodName)
          Sets the caller method name.
 void setPackageName(String packageName)
          Sets the caller package name.
 void setThreadName(String threadName)
          Sets the caller thread name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogEventLocation

public LogEventLocation()
Constructs a new LogEventLocation without any information.

Since:
1.0.0

LogEventLocation

public LogEventLocation(Class<?> source)
Constructs a new LogEventLocation for a given class.

Parameters:
source - The callers class.
Since:
1.0.0

LogEventLocation

public LogEventLocation(Class<?> source,
                        String methodName)
Constructs a new LogEventLocation for a given method and class.

Parameters:
source - The caller class.
methodName - The caller method.
Since:
1.0.0

LogEventLocation

public LogEventLocation(String packageName,
                        String className)
Constructs a new LogEventLocation for a given package and class.

Parameters:
packageName - The caller package name.
className - The caller class name.
Since:
1.0.0

LogEventLocation

public LogEventLocation(String packageName,
                        String className,
                        String methodName)
Constructs a new LogEventLocation for a given package, class and method.

Parameters:
packageName - The caller package name.
className - The caller class name.
methodName - The caller method name.
Since:
1.0.0

LogEventLocation

public LogEventLocation(String packageName,
                        String className,
                        String methodName,
                        String fileName)
Constructs a new LogEventLocation for a given package, class, method and file.

Parameters:
packageName - The caller package name.
className - The caller class name.
methodName - The caller method name.
fileName - The caller file name.
Since:
1.0.0

LogEventLocation

public LogEventLocation(String packageName,
                        String className,
                        String methodName,
                        String fileName,
                        int lineNumber)
Constructs a new LogEventLocation for a given package, class, method, file and line.

Parameters:
packageName - The caller package name.
className - The caller class name.
methodName - The caller method name.
fileName - The caller file name.
lineNumber - The caller line number.
Since:
1.0.0

LogEventLocation

public LogEventLocation(String packageName,
                        String className,
                        String methodName,
                        String fileName,
                        int lineNumber,
                        String threadName)
Constructs a new LogEventLocation for a given package, class, method, file, line and thread.

Parameters:
packageName - The caller package name.
className - The caller class name.
methodName - The caller method name.
fileName - The caller file name.
lineNumber - The caller line number.
threadName - The caller thread name.
Since:
1.0.0
Method Detail

getPackageName

public final String getPackageName()
Gets the caller package name.

Returns:
The caller package name.
Since:
1.0.0

setPackageName

public final void setPackageName(String packageName)
Sets the caller package name. If the name is null, the package will be identified by a empty string.

Parameters:
packageName - The caller package name.
Since:
1.0.0

getClassName

public final String getClassName()
Gets the caller class name.

Returns:
The caller class name.
Since:
1.0.0

setClassName

public final void setClassName(String className)
Sets the caller class name. If the name is null, the class will be identified by a empty string.

Parameters:
className - The caller class name.
Since:
1.0.0

getMethodName

public final String getMethodName()
Gets the caller method name.

Returns:
The caller method name.
Since:
1.0.0

setMethodName

public final void setMethodName(String methodName)
Sets the caller method name. If the name is null, the method will be identified by a empty string.

Parameters:
methodName - The caller method name.
Since:
1.0.0

getLineNumber

public final String getLineNumber()
Gets the caller line number.

Returns:
The caller line number.
Since:
1.0.0

setLineNumber

public final void setLineNumber(int lineNumber)
Sets the caller line number.

Parameters:
lineNumber - The caller line number.
Since:
1.0.0

getFileName

public final String getFileName()
Gets the caller file name.

Returns:
The caller file name.
Since:
1.0.0

setFileName

public final void setFileName(String fileName)
Sets the caller file name. If the name is null, the file will be identified by a empty string.

Parameters:
fileName - The caller file name.
Since:
1.0.0

getThreadName

public final String getThreadName()
Gets the caller thread name.

Returns:
The caller thread name.
Since:
1.0.0

setThreadName

public final void setThreadName(String threadName)
Sets the caller thread name. If the name is null, the thread will be identified by a empty string.

Parameters:
threadName - The caller thread name.
Since:
1.0.0

getFullQualifiedName

public String getFullQualifiedName()
Gets the full qualified name of the callers class.

Returns:
The full qualified name of the callers class.
Since:
1.0.0

getJavadocLikeName

public String getJavadocLikeName()
Gets a javadoc like name for the caller, this name resembles something like caller.package.SomeClass#aMethod.

Returns:
A javadoc like name for the caller.
Since:
1.0.0

getStackTraceLikeName

public String getStackTraceLikeName()
Gets a string representing the file name and line number of the caller. If there is no information about them, an empty string is returned. The resulting string will resemble something like (file.java:10).

Returns:
A string representing the file name and line number of the caller.
Since:
1.0.0


Copyright © 2007-2010 The AceLogger Team. All Rights Reserved.