FileDocCategorySizeDatePackage
InnerClassFilenameFilter.javaAPI DocApache Ant 1.701928Wed Dec 13 06:16:18 GMT 2006org.apache.tools.ant.taskdefs.optional.ejb

InnerClassFilenameFilter

public class InnerClassFilenameFilter extends Object implements FilenameFilter
A filename filter for inner class files of a particular class.

Fields Summary
private String
baseClassName
Constructors Summary
InnerClassFilenameFilter(String baseclass)
Constructor of filter.

param
baseclass the class to filter inner classes on.

        int extidx = baseclass.lastIndexOf(".class");
        if (extidx == -1) {
            extidx = baseclass.length() - 1;
        }
        baseClassName = baseclass.substring(0, extidx);
    
Methods Summary
public booleanaccept(java.io.File dir, java.lang.String filename)
Check if the file name passes the filter.

param
dir not used.
param
filename the filename to filter on.
return
true if the filename is an inner class of the base class.

        if ((filename.lastIndexOf(".") != filename.lastIndexOf(".class"))
            || (filename.indexOf(baseClassName + "$") != 0)) {
            return false;
        }
        return true;