From 294051d2d9561c8e1f9b237c672f68b0da2a9692 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Wed, 14 Aug 2024 19:27:58 -0700 Subject: [PATCH] Prep for Ion builder fix --- .../dataformat/ion/IonObjectMapper.java | 16 ++++++++++-- .../ion/ionvalue/IonValueMapper.java | 26 +++++++++++++++++++ 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonObjectMapper.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonObjectMapper.java index dd3658a8a..95366bde5 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonObjectMapper.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/IonObjectMapper.java @@ -104,7 +104,7 @@ public Builder configure(IonGenerator.Feature feature, boolean state) { /* /********************************************************************** - /* Life-cycle + /* Life-cycle, constructors /********************************************************************** */ @@ -135,6 +135,12 @@ protected IonObjectMapper(IonObjectMapper src) { super(src); } + /* + /********************************************************************** + /* Life-cycle, builders + /********************************************************************** + */ + /** * A builder for a mapper that will use textual writers by default. Same as * {@link #builderForTextualWriters()}. @@ -189,6 +195,12 @@ public static Builder builder(IonFactory streamFactory) { return new Builder(new IonObjectMapper(streamFactory)); } + /* + /********************************************************************** + /* Life-cycle, other + /********************************************************************** + */ + @Override public ObjectMapper copy() { _checkInvalidCopy(IonObjectMapper.class); @@ -204,7 +216,7 @@ public Version version() { return PackageVersion.VERSION; } - /* + /* /********************************************************************** /* Configuration /********************************************************************** diff --git a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/ionvalue/IonValueMapper.java b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/ionvalue/IonValueMapper.java index d1113fd4f..e2f103bf9 100644 --- a/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/ionvalue/IonValueMapper.java +++ b/ion/src/main/java/com/fasterxml/jackson/dataformat/ion/ionvalue/IonValueMapper.java @@ -37,6 +37,12 @@ public class IonValueMapper extends IonObjectMapper { private static final long serialVersionUID = 1L; + /* + /********************************************************************** + /* Life-cycle, constructors + /********************************************************************** + */ + /** * Constructor which provides a mapper with a null {@link PropertyNamingStrategy}. * @@ -66,11 +72,31 @@ public IonValueMapper(IonSystem ionSystem, PropertyNamingStrategy strategy) { this.setPropertyNamingStrategy(strategy); } + /* + /********************************************************************** + /* Life-cycle, builders + /********************************************************************** + */ + + // TODO: add overrides + + /* + /********************************************************************** + /* Life-cycle, other + /********************************************************************** + */ + @Override // @since 2.18 public ObjectMapper copy() { _checkInvalidCopy(IonValueMapper.class); return new IonValueMapper(this); } + + /* + /********************************************************************** + /* Extended API + /********************************************************************** + */ public T parse(IonValue value, Class clazz) throws IOException { if (value == null) {