net.sourceforge.acelogger.location.gatherer
Class BaseLocationGatherer

java.lang.Object
  extended by net.sourceforge.acelogger.location.gatherer.BaseLocationGatherer
All Implemented Interfaces:
Identifiable, LocationGatherer
Direct Known Subclasses:
FileAndLineLocationGatherer, FullLocationGatherer

public abstract class BaseLocationGatherer
extends Object
implements LocationGatherer

Abstracts common tasks for LocationGatherer.

Since:
1.0.0
Version:
1.0.0
Author:
Zardi (https://sourceforge.net/users/daniel_zardi)

Constructor Summary
BaseLocationGatherer(String identifier)
          Constructs a BaseLocationGatherer with the supplied identifier and a UserCodeFrameResolver as it's resolver.
BaseLocationGatherer(String identifier, CodeFrameResolver codeFrameResolver)
          Constructs a BaseLocationGatherer with the supplied identifier and resolver.
 
Method Summary
 LogEventLocation getCallLocation()
          Obtains the log call location, such as the package, class and method names.
 CodeFrameResolver getCodeFrameResolver()
          Returns the CodeFrameResolver used by this gatherer.
 String getIdentifier()
          Gets a String that identifies this object.
protected  StackTraceElement getUserCodeFrame(Thread currentThread)
          A short-hand to get the caller location.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sourceforge.acelogger.location.gatherer.LocationGatherer
getCallLocation
 

Constructor Detail

BaseLocationGatherer

public BaseLocationGatherer(String identifier)
Constructs a BaseLocationGatherer with the supplied identifier and a UserCodeFrameResolver as it's resolver.

Parameters:
identifier - A string that identifies this gatherer.
Since:
1.0.0

BaseLocationGatherer

public BaseLocationGatherer(String identifier,
                            CodeFrameResolver codeFrameResolver)
Constructs a BaseLocationGatherer with the supplied identifier and resolver.

Parameters:
identifier - A string that identifies this gatherer.
codeFrameResolver - The resolver that should be used to generate caller information.
Since:
1.0.0
Method Detail

getIdentifier

public final String getIdentifier()
Gets a String that identifies this object.

Specified by:
getIdentifier in interface Identifiable
Returns:
The identifier of this object.

getCodeFrameResolver

public final CodeFrameResolver getCodeFrameResolver()
Returns the CodeFrameResolver used by this gatherer.

Returns:
The resolver that is used to generate caller information.
Since:
1.0.0

getCallLocation

public LogEventLocation getCallLocation()
Obtains the log call location, such as the package, class and method names.

Specified by:
getCallLocation in interface LocationGatherer
Returns:
A logCallLocation with information of the caller location.

getUserCodeFrame

protected StackTraceElement getUserCodeFrame(Thread currentThread)
A short-hand to get the caller location.

Parameters:
currentThread - The thread that originated the call.
Returns:
The frame that originated the call.
Since:
1.0.0


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