Package com.diffplug.spotless
Interface FormatExceptionPolicy
-
- All Superinterfaces:
NoLambda
,java.io.Serializable
- All Known Implementing Classes:
FormatExceptionPolicyStrict
public interface FormatExceptionPolicy extends java.io.Serializable, NoLambda
A policy for handling exceptions in the format.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.diffplug.spotless.NoLambda
NoLambda.EqualityBasedOnSerialization
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static FormatExceptionPolicy
failOnlyOnError()
A policy which rethrows subclasses ofError
and logs other kinds of Exception.void
handleError(java.lang.Throwable e, FormatterStep step, java.lang.String relativePath)
Called for every error in the formatter.byte[]
toBytes()
Returns a byte array representation of everything inside thisFormatExceptionPolicy
.
-
-
-
Method Detail
-
handleError
void handleError(java.lang.Throwable e, FormatterStep step, java.lang.String relativePath)
Called for every error in the formatter.
-
toBytes
byte[] toBytes()
Returns a byte array representation of everything inside thisFormatExceptionPolicy
.The main purpose of this method is to ensure one can't instantiate this class with lambda expressions, which are notoriously difficult to serialize and deserialize properly.
-
failOnlyOnError
static FormatExceptionPolicy failOnlyOnError()
A policy which rethrows subclasses ofError
and logs other kinds of Exception.
-
-