Name
CodingErrorAction
Synopsis
This class is a typesafe enumeration that
defines three constants that serve as the legal argument values to
the onMalformedInput(
)
and onUnmappableCharacter(
) methods of CharsetDecoder and
CharsetEncoder. These constants specify how
malformed input and unmappable error conditions should be handled.
The values are:
-
CodingErrorAction.REPORT Specifies that the error should be reported. This is done by returning a
CoderResultobject from the three-argument version ofdecode( )orencode( )or by throwing aMalformedInputExceptionorUnmappableCharacterExceptionfrom the one-argument version ofdecode( )orencode( ). This is the default action for both error types for bothCharsetDecoderandCharsetEncoder.-
CodingErrorAction.IGNORE Specifies that the malformed input or unmappable input character should simply be skipped, with no output.
-
CodingErrorAction.REPLACE Specifies that the malformed input or unmappable character should be skipped and the replacement string or replacement bytes should be appended to the output.
See CharsetDecoder for more information.
public class CodingErrorAction { // No Constructor // Public Constants public static final CodingErrorAction IGNORE; public static final CodingErrorAction REPLACE; public static final CodingErrorAction REPORT; // Public Methods Overriding Object public String toString( ); }
Passed To
CharsetDecoder.{implOnMalformedInput( ),
implOnUnmappableCharacter( ),
onMalformedInput( ),
onUnmappableCharacter( ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access