bb.io.filefilter
Class BaseFilter.UnitTest.TestFilter
java.lang.Object
javax.swing.filechooser.FileFilter
bb.io.filefilter.BaseFilter
bb.io.filefilter.BaseFilter.UnitTest.TestFilter
- All Implemented Interfaces:
- FileFilter
- Enclosing class:
- BaseFilter.UnitTest
private static class BaseFilter.UnitTest.TestFilter
- extends BaseFilter
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
textExpected
private final String textExpected
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
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