snaq.util.jclap
Class StringOption.FileFilter

java.lang.Object
  extended by snaq.util.jclap.StringOption.FileFilter
All Implemented Interfaces:
StringOption.Filter
Enclosing class:
StringOption

public static final class StringOption.FileFilter
extends java.lang.Object
implements StringOption.Filter

Implementation of an StringOption.Filter which filters based on existence and type of file to which the string refers.


Nested Class Summary
static class StringOption.FileFilter.AcceptExistance
          Enumeration of possible file existence states to accept.
static class StringOption.FileFilter.AcceptFileType
          Enumeration of possible types to accept.
 
Constructor Summary
StringOption.FileFilter(StringOption.FileFilter.AcceptExistance eType, StringOption.FileFilter.AcceptFileType fType)
          Creates a new FileOption instance (allows files/folders).
 
Method Summary
 boolean accept(java.lang.String arg)
          Determines whether the string argument is valid as an option value.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringOption.FileFilter

public StringOption.FileFilter(StringOption.FileFilter.AcceptExistance eType,
                               StringOption.FileFilter.AcceptFileType fType)
Creates a new FileOption instance (allows files/folders).

Parameters:
eType - type of files to accept/reject based on existence
fType - type of files to accept/reject based on file/directory status
Method Detail

accept

public boolean accept(java.lang.String arg)
Determines whether the string argument is valid as an option value.

Specified by:
accept in interface StringOption.Filter
Parameters:
arg - string argument to check for validity as an option value
Returns:
Whether the string argument is valid as an option value.