bb.io.filefilter
Class BaseFilter.UnitTest.TestFilter

java.lang.Object
  extended by javax.swing.filechooser.FileFilter
      extended by bb.io.filefilter.BaseFilter
          extended by bb.io.filefilter.BaseFilter.UnitTest.TestFilter
All Implemented Interfaces:
FileFilter
Enclosing class:
BaseFilter.UnitTest

private static class BaseFilter.UnitTest.TestFilter
extends BaseFilter


Nested Class Summary
 
Nested classes/interfaces inherited from class bb.io.filefilter.BaseFilter
BaseFilter.UnitTest
 
Field Summary
private  String textExpected
           
 
Constructor Summary
private BaseFilter.UnitTest.TestFilter(DirectoryMode directoryMode)
           
private BaseFilter.UnitTest.TestFilter(FileMode fileMode)
           
private BaseFilter.UnitTest.TestFilter(FileMode fileMode, DirectoryMode directoryMode, OtherMode otherMode, PartMode partMode, String textExpected)
           
private BaseFilter.UnitTest.TestFilter(OtherMode otherMode)
           
private BaseFilter.UnitTest.TestFilter(PartMode partMode, String textExpected)
           
 
Method Summary
 String getDescription()
          
protected  boolean passesTest(String part)
          Determines whether or not part (which is some part of a File's full path) passes this filter's test.
 
Methods inherited from class bb.io.filefilter.BaseFilter
accept, acceptImpl, extractPart, getDirectoryMode, getFileMode, getListener, getOtherMode, getPartMode, passesTest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textExpected

private final String textExpected
Constructor Detail

BaseFilter.UnitTest.TestFilter

private BaseFilter.UnitTest.TestFilter(FileMode fileMode)
                                throws IllegalArgumentException
Throws:
IllegalArgumentException

BaseFilter.UnitTest.TestFilter

private BaseFilter.UnitTest.TestFilter(DirectoryMode directoryMode)
                                throws IllegalArgumentException
Throws:
IllegalArgumentException

BaseFilter.UnitTest.TestFilter

private BaseFilter.UnitTest.TestFilter(OtherMode otherMode)
                                throws IllegalArgumentException
Throws:
IllegalArgumentException

BaseFilter.UnitTest.TestFilter

private BaseFilter.UnitTest.TestFilter(PartMode partMode,
                                       String textExpected)
                                throws IllegalArgumentException
Throws:
IllegalArgumentException

BaseFilter.UnitTest.TestFilter

private BaseFilter.UnitTest.TestFilter(FileMode fileMode,
                                       DirectoryMode directoryMode,
                                       OtherMode otherMode,
                                       PartMode partMode,
                                       String textExpected)
                                throws IllegalArgumentException
Throws:
IllegalArgumentException
Method Detail

passesTest

protected boolean passesTest(String part)
Description copied from class: BaseFilter
Determines whether or not part (which is some part of a File's full path) passes this filter's test.

The implementation here always throws an IllegalStateException.

Subclasses must either override this method or ensure that it is never called. There are two ways that they can achieve the latter. First, they could make FileMode/DirectoryMode/OtherMode choices that cover all cases before any other detail of the file is considered. This is the approach taken by DirectoryFilter and NormalFileFilter. Second, they could override one or more of the methods in this method's call chain (i.e. override BaseFilter.passesTest(File), acceptImpl, accept). in a manner that does not call the implementation here. This is the approach taken by many classes, such as TarableFilter and VisibleFilter.

This method is not abstract to avoid forcing subclasses which do not call it (as described above) to implement it.

Overrides:
passesTest in class BaseFilter

getDescription

public String getDescription()
Description copied from class: BaseFilter

Specified by:
getDescription in class BaseFilter