org.extex.resource
Class AbstractFinder

java.lang.Object
  extended by org.extex.resource.AbstractFinder
All Implemented Interfaces:
LogEnabled, ResourceFinder
Direct Known Subclasses:
ClasspathArchiveFinder, ClasspathFinder, FileFinder, FileFinderRPath, LsrFinder, UrlFinder

public abstract class AbstractFinder
extends java.lang.Object
implements LogEnabled, ResourceFinder

This the abstract base class to provide the infrastructure for resource finders.

Version:
$Revision: 7166 $
Author:
Gerd Neugebauer

Field Summary
protected static java.lang.String ATTR_DEFAULT
          The constant ATTR_DEFAULT contains the attribute name for the default type.
protected static java.lang.String ATTR_SKIP
          The field ATTR_SKIP contains the attribute name for the skip indicator.
protected static java.lang.String ATTR_TRACE
          The constant ATTR_TRACE contains the attribute name for the tracing enabler.
protected static java.lang.String EXTENSION_TAG
          The constant EXTENSION_TAG contains the name of the tag to get the possible extensions.
 
Constructor Summary
AbstractFinder(Configuration configuration)
          Creates a new object.
 
Method Summary
 void enableLogging(java.util.logging.Logger theLogger)
          Setter for the logger.
 void enableTracing(boolean flag)
          Enable or disable the tracing.
protected  Configuration getConfiguration()
          Getter for configuration.
protected  void trace(java.lang.String key, java.lang.Object... args)
          Produce an internationalized trace message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.extex.resource.ResourceFinder
findResource
 

Field Detail

ATTR_DEFAULT

protected static final java.lang.String ATTR_DEFAULT
The constant ATTR_DEFAULT contains the attribute name for the default type.

See Also:
Constant Field Values

ATTR_SKIP

protected static final java.lang.String ATTR_SKIP
The field ATTR_SKIP contains the attribute name for the skip indicator.

See Also:
Constant Field Values

ATTR_TRACE

protected static final java.lang.String ATTR_TRACE
The constant ATTR_TRACE contains the attribute name for the tracing enabler.

See Also:
Constant Field Values

EXTENSION_TAG

protected static final java.lang.String EXTENSION_TAG
The constant EXTENSION_TAG contains the name of the tag to get the possible extensions.

See Also:
Constant Field Values
Constructor Detail

AbstractFinder

public AbstractFinder(Configuration configuration)
               throws ConfigurationMissingException
Creates a new object.

Parameters:
configuration - the encapsulated configuration object
Throws:
ConfigurationMissingException - in case of an error: The argument configuration is null.
Method Detail

enableLogging

public void enableLogging(java.util.logging.Logger theLogger)
Setter for the logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
theLogger - the logger to set.
See Also:
LogEnabled.enableLogging( java.util.logging.Logger)

enableTracing

public void enableTracing(boolean flag)
Enable or disable the tracing. The argument indicates whether tracing should be enabled or disabled. The resource finder can decide on its own how to perform tracing. The preferred way is to write tracing records to a logger.

Specified by:
enableTracing in interface ResourceFinder
Parameters:
flag - indicator whether tracing should be turned on or off.
See Also:
ResourceFinder.enableTracing(boolean)

getConfiguration

protected Configuration getConfiguration()
Getter for configuration.

Returns:
the configuration

trace

protected void trace(java.lang.String key,
                     java.lang.Object... args)
Produce an internationalized trace message.

Parameters:
key - the resource key for the message format
args - the arguments to insert