java.lang.Object
java.lang.Throwable
java.lang.Exception
com.google.zxing.ReaderException
com.google.zxing.FormatException
- All Implemented Interfaces:
Serializable
Thrown when a barcode was successfully detected, but some aspect of the content did not conform to the barcode's format rules. This could have been due to a mis-detection.
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final FormatExceptionShared instance, as the exception carries no message.Fields inherited from class ReaderException
isStackTrace, NO_TRACEModifier and TypeFieldDescriptionprotected static final booleandisable stack traces when not running inside test unitsprotected static final StackTraceElement[]empty stack trace array for disabled stack tracesConstructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates the shared instance.privateFormatException(Throwable cause) Records what went wrong.Method Summary
All MethodsModifier and TypeMethodDescriptionstatic FormatExceptionGet the shared instance, or a fresh one when stack traces are enabled.static FormatExceptiongetFormatInstance(Throwable cause) Get an instance wrapping the given cause.Methods inherited from class ReaderException
fillInStackTraceMethods inherited from class Throwable
addSuppressed, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Field Details
INSTANCE
Shared instance, as the exception carries no message.
Constructor Details
FormatException
private FormatException()Creates the shared instance.FormatException
Records what went wrong.- Parameters:
cause- the underlying failure
Method Details
getFormatInstance
Get the shared instance, or a fresh one when stack traces are enabled.- Returns:
- the format instance
getFormatInstance
Get an instance wrapping the given cause.- Parameters:
cause- underlying throwable wrapped by the new exception- Returns:
- the format instance