public class Recognizer extends java.lang.Object implements Scanner.Action
Modifier and Type | Method and Description |
---|---|
void |
addKnownName(java.lang.String name,
Scanner.Action action) |
void |
addKnownSuffix(java.lang.String suffix,
Scanner.Action action) |
void |
dump() |
boolean |
evaluate(FileWrapper file)
Apply the action that matches the classification of this file.
|
void |
setDefaultAction(Scanner.Action action)
This defines the default action.
|
void |
setShellScriptAction(Scanner.Action action)
If set, this defines the action taken for text files that start with the
patter "#!", which is the standard for all *nix shell scripts.
|
java.lang.String |
toString() |
public void dump()
public java.lang.String toString()
toString
in class java.lang.Object
public void addKnownName(java.lang.String name, Scanner.Action action)
public void addKnownSuffix(java.lang.String suffix, Scanner.Action action)
public void setShellScriptAction(Scanner.Action action)
action
- The action to perform on shell scripts.public void setDefaultAction(Scanner.Action action)
action
- The default action is nothing else matches.public boolean evaluate(FileWrapper file)
evaluate
in interface UnaryPredicate<FileWrapper>
file
- The file to act upon.