Skip to content

Commit a2a738a

Browse files
committed
Merge branch 'feature/jackson3' into develop
2 parents be5c9ca + 723d20f commit a2a738a

File tree

18 files changed

+124
-131
lines changed

18 files changed

+124
-131
lines changed

README-CHANGES.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<c:change date="2024-05-11T00:00:00+00:00" summary="Move to new organization."/>
1818
</c:changes>
1919
</c:release>
20-
<c:release date="2025-08-26T11:22:08+00:00" is-open="false" ticket-system="com.github.io7m.dixmont" version="2.1.0">
20+
<c:release date="2025-08-26T00:00:00+00:00" is-open="false" ticket-system="com.github.io7m.dixmont" version="2.1.0">
2121
<c:changes>
2222
<c:change date="2024-06-28T00:00:00+00:00" summary="Update junit.version:5.10.2 → 5.10.3."/>
2323
<c:change date="2024-07-08T00:00:00+00:00" summary="Update jackson.version:2.17.1 → 2.17.2."/>
@@ -54,6 +54,11 @@
5454
<c:change date="2025-08-26T00:00:00+00:00" summary="Target JDK 17 bytecode."/>
5555
</c:changes>
5656
</c:release>
57+
<c:release date="2025-11-29T09:49:50+00:00" is-open="true" ticket-system="com.github.io7m.dixmont" version="3.0.0">
58+
<c:changes>
59+
<c:change compatible="false" date="2025-11-29T09:49:50+00:00" summary="Upgrade to Jackson 3.0.2."/>
60+
</c:changes>
61+
</c:release>
5762
</c:releases>
5863
<c:ticket-systems>
5964
<c:ticket-system default="true" id="com.github.io7m.dixmont" url="https://www.github.com/io7m/dixmont/issues/"/>

README.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $ mvn clean verify
3232
### Usage
3333

3434
Create a restricted serializer that is permitted to deserialize only the
35-
given classes and no others, and then register it with an `ObjectMapper`:
35+
given classes and no others, and then register it with a mapper:
3636

3737
```
3838
var serializers =
@@ -50,13 +50,13 @@ var serializers =
5050
"java.util.List<java.lang.String>")
5151
.build();
5252

53-
var mapper =
54-
JsonMapper.builder()
55-
.build();
56-
5753
final var simpleModule = new SimpleModule();
5854
simpleModule.setDeserializers(this.serializers);
59-
mapper.registerModule(simpleModule);
55+
56+
final var mapper =
57+
JsonMapper.builder()
58+
.addModule(simpleModule)
59+
.build();
6060
```
6161

6262
Parser code using the given `ObjectMapper` will be prevented from deserializing

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ mvn clean verify
4848
### Usage
4949

5050
Create a restricted serializer that is permitted to deserialize only the
51-
given classes and no others, and then register it with an `ObjectMapper`:
51+
given classes and no others, and then register it with a mapper:
5252

5353
```
5454
var serializers =
@@ -66,13 +66,13 @@ var serializers =
6666
"java.util.List<java.lang.String>")
6767
.build();
6868
69-
var mapper =
70-
JsonMapper.builder()
71-
.build();
72-
7369
final var simpleModule = new SimpleModule();
7470
simpleModule.setDeserializers(this.serializers);
75-
mapper.registerModule(simpleModule);
71+
72+
final var mapper =
73+
JsonMapper.builder()
74+
.addModule(simpleModule)
75+
.build();
7676
```
7777

7878
Parser code using the given `ObjectMapper` will be prevented from deserializing

com.io7m.dixmont.colors/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>com.io7m.dixmont</artifactId>
1111
<groupId>com.io7m.dixmont</groupId>
12-
<version>2.2.0-SNAPSHOT</version>
12+
<version>3.0.0-SNAPSHOT</version>
1313
</parent>
1414
<artifactId>com.io7m.dixmont.colors</artifactId>
1515

@@ -20,11 +20,11 @@
2020

2121
<dependencies>
2222
<dependency>
23-
<groupId>com.fasterxml.jackson.core</groupId>
23+
<groupId>tools.jackson.core</groupId>
2424
<artifactId>jackson-databind</artifactId>
2525
</dependency>
2626
<dependency>
27-
<groupId>com.fasterxml.jackson.core</groupId>
27+
<groupId>tools.jackson.core</groupId>
2828
<artifactId>jackson-core</artifactId>
2929
</dependency>
3030

com.io7m.dixmont.colors/src/main/java/com/io7m/dixmont/colors/DmColorDeserializer.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@
1616

1717
package 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;
2524
import 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
}

com.io7m.dixmont.colors/src/main/java/com/io7m/dixmont/colors/DmColorModule.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717

1818
package com.io7m.dixmont.colors;
1919

20-
import com.fasterxml.jackson.databind.Module;
21-
import com.fasterxml.jackson.databind.module.SimpleModule;
20+
import tools.jackson.databind.JacksonModule;
21+
import tools.jackson.databind.module.SimpleModule;
2222

2323
/**
2424
* The color module.
@@ -37,7 +37,7 @@ private DmColorModule()
3737
* @return The created module
3838
*/
3939

40-
public static Module create()
40+
public static JacksonModule create()
4141
{
4242
final var module = new SimpleModule();
4343
module.addDeserializer(DmColor.class, new DmColorDeserializer());

com.io7m.dixmont.colors/src/main/java/com/io7m/dixmont/colors/DmColorSerializer.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
package com.io7m.dixmont.colors;
1818

19-
import com.fasterxml.jackson.core.JsonGenerator;
20-
import com.fasterxml.jackson.databind.SerializerProvider;
21-
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
22-
23-
import java.io.IOException;
19+
import tools.jackson.core.JsonGenerator;
20+
import tools.jackson.databind.SerializationContext;
21+
import tools.jackson.databind.ser.std.StdSerializer;
2422

2523
/**
2624
* A serializer for color values.
@@ -55,8 +53,7 @@ public DmColorSerializer(
5553
public void serialize(
5654
final DmColor value,
5755
final JsonGenerator jgen,
58-
final SerializerProvider provider)
59-
throws IOException
56+
final SerializationContext provider)
6057
{
6158
jgen.writeString(value.toString());
6259
}

com.io7m.dixmont.colors/src/main/java/com/io7m/dixmont/colors/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020

2121
@Export
22-
@Version("1.0.0")
22+
@Version("2.0.0")
2323
package com.io7m.dixmont.colors;
2424

2525
import org.osgi.annotation.bundle.Export;

com.io7m.dixmont.colors/src/main/java/module-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
requires static org.osgi.annotation.bundle;
2424
requires static org.osgi.annotation.versioning;
2525

26-
requires transitive com.fasterxml.jackson.core;
27-
requires transitive com.fasterxml.jackson.databind;
26+
requires tools.jackson.core;
27+
requires tools.jackson.databind;
2828

2929
exports com.io7m.dixmont.colors;
3030

com.io7m.dixmont.core/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<parent>
1010
<artifactId>com.io7m.dixmont</artifactId>
1111
<groupId>com.io7m.dixmont</groupId>
12-
<version>2.2.0-SNAPSHOT</version>
12+
<version>3.0.0-SNAPSHOT</version>
1313
</parent>
1414
<artifactId>com.io7m.dixmont.core</artifactId>
1515

@@ -20,7 +20,7 @@
2020

2121
<dependencies>
2222
<dependency>
23-
<groupId>com.fasterxml.jackson.core</groupId>
23+
<groupId>tools.jackson.core</groupId>
2424
<artifactId>jackson-databind</artifactId>
2525
</dependency>
2626
<dependency>

0 commit comments

Comments
 (0)