Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.further.jaudit
Class SourceFilenameFilter  view SourceFilenameFilter download SourceFilenameFilter.java

java.lang.Object
  extended bycom.further.jaudit.SourceFilenameFilter
All Implemented Interfaces:
java.io.FilenameFilter

public class SourceFilenameFilter
extends java.lang.Object
implements java.io.FilenameFilter

This filter implements a source file filter for directory traversal. The intent of the filter is to allow the configuration to statically specify file extensions that are valid source files, then the system uses the SourceFilenameFilter to test the contents of the source tree against those extensions.

Since:
1.0
Version:
1.0

Field Summary
private static SourceFilenameFilter instance
          The singleton instance of the source filename filter
private static java.util.Set sourceFileExtensions
          This set contains the list of extensions that constitute source files, without the last "."
 
Constructor Summary
private SourceFilenameFilter()
          This class is a singleton, it cannot be created.
 
Method Summary
 boolean accept(java.io.File dir, java.lang.String name)
          Test if a file is a source file, which implies that it has a specific extension that is registered with the configuration system (and subsequently in the source file extension set)
static SourceFilenameFilter getInstance()
          Retreive the global singleton for the source filename filter.
static void registerSourceExtension(java.lang.String ext)
          Register the given extension as a valid source file extension for cataloging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sourceFileExtensions

private static java.util.Set sourceFileExtensions
This set contains the list of extensions that constitute source files, without the last "."


instance

private static SourceFilenameFilter instance
The singleton instance of the source filename filter

Constructor Detail

SourceFilenameFilter

private SourceFilenameFilter()
This class is a singleton, it cannot be created.

Method Detail

registerSourceExtension

public static void registerSourceExtension(java.lang.String ext)
Register the given extension as a valid source file extension for cataloging. This assumes the given extension does not include the trailing ".".


getInstance

public static SourceFilenameFilter getInstance()
Retreive the global singleton for the source filename filter.


accept

public boolean accept(java.io.File dir,
                      java.lang.String name)
Test if a file is a source file, which implies that it has a specific extension that is registered with the configuration system (and subsequently in the source file extension set)

Specified by:
accept in interface java.io.FilenameFilter