Package Torello.Java
Interface IOExceptionHandler
-
- All Superinterfaces:
java.util.function.BiConsumer<FileNode,java.io.IOException>
,java.io.Serializable
public interface IOExceptionHandler extends java.util.function.BiConsumer<FileNode,java.io.IOException>, java.io.Serializable
A functional-interface, used in case ofIOException
, to be used alongside the'GREP'
Tool.
This class is just intended to handle {@code IOException's}, and perform User-Defined actions when a GREP fails for a particular file. The primary value of this interface is that users can handle exceptions without halting the entire {@code GREP} method for the rest of the files merely because of a failure with a single file.
Hi-Lited Source-Code:- View Here: Torello/Java/IOExceptionHandler.java
- Open New Browser-Tab: Torello/Java/IOExceptionHandler.java
File Size: 1,414 Bytes Line Count: 35 '\n' Characters Found
-
-
Field Summary
Serializable ID Modifier and Type Field static long
serialVersionUID
Standard Handler Instance Modifier and Type Field static IOExceptionHandler
SIMPLE
-
-
-
Field Detail
-
serialVersionUID
static final long serialVersionUID
This fulfils the SerialVersion UID requirement for all classes that implement Java'sinterface java.io.Serializable
. Using theSerializable
Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.
Functional Interfaces are usually not thought of as Data Objects that need to be saved, stored and retrieved; however, having the ability to store intermediate results along with the lambda-functions that helped get those results can make debugging easier.- See Also:
- Constant Field Values
- Code:
- Exact Field Declaration Expression:
public static final long serialVersionUID = 1;
-
SIMPLE
static final IOExceptionHandler SIMPLE
Unless a more advanced behavior is expected, thisIOException
handler should suffice for most of the routines in theGREP
and theFileNode
classes. It simply prints the standardIOException
stack trace to the standardSystem out
.
-
-
Method Detail
-
accept
void accept(FileNode fn, java.io.IOException e)
FunctionalInterface Target-Method:
This method corresponds to the@FunctionalInterface
Annotation's method requirement. It is the only non-default
, non-static
method in this interface, and may be the target of a Lambda-Expression or'::'
(double-colon) Function-Pointer.- Specified by:
accept
in interfacejava.util.function.BiConsumer<FileNode,java.io.IOException>
- Parameters:
fn
- This may be any FileNodee
- This exception is passed indicating that anIOException
occurred when attempting to search or'GREP'
through this file. The programmer may do or perform any type of exception handling needed.
-
-