+ protected ChessQRResult createResult(DecoderResult decoderResult) throws ChessQRCodeException {
+ String result = decoderResult.getText();
+
+ ChessQRCodeMode mode = ChessQRResult.getMode(result);
+ if (mode == null) {
+ throw new ChessQRCodeException(
+ ChessQRCodeException.Type.READ, "read.unknown.chess.mode"
+ );
+ }
+
+ return new ChessQRResult(
+ mode,
+ ChessQRResult.getContents(result)
+ );
+ }
+