1616
1717package com .io7m .dixmont .colors ;
1818
19- import com . fasterxml . jackson .core .JsonParseException ;
20- import com . fasterxml . jackson .core . JsonParser ;
21- import com . fasterxml . jackson .databind .DeserializationContext ;
22- import com . fasterxml . jackson .databind .deser . std . StdDeserializer ;
19+ import tools . jackson .core .JsonParser ;
20+ import tools . jackson .databind . DeserializationContext ;
21+ import tools . jackson .databind .deser . std . StdDeserializer ;
22+ import tools . jackson .databind .exc . MismatchedInputException ;
2323
24- import java .io .IOException ;
2524import java .util .regex .Pattern ;
2625
2726/**
@@ -40,7 +39,7 @@ public final class DmColorDeserializer
4039
4140 public DmColorDeserializer ()
4241 {
43- this (null );
42+ this (DmColor . class );
4443 }
4544
4645 /**
@@ -59,7 +58,6 @@ public DmColorDeserializer(
5958 public DmColor deserialize (
6059 final JsonParser p ,
6160 final DeserializationContext ctxt )
62- throws IOException
6361 {
6462 final var text = p .getValueAsString ();
6563
@@ -75,10 +73,10 @@ public DmColor deserialize(
7573 );
7674 }
7775
78- throw new JsonParseException (
76+ throw MismatchedInputException . from (
7977 p ,
80- "Color values must match the pattern %s" . formatted ( COLOR_PATTERN ) ,
81- p . getCurrentLocation ( )
78+ DmColor . class ,
79+ "Color values must match the pattern %s" . formatted ( COLOR_PATTERN )
8280 );
8381 }
8482}
0 commit comments