11package com .fasterxml .jackson .databind .cfg ;
22
3- import java .io .IOException ;
4- import java .util .List ;
5-
6- import com .fasterxml .jackson .databind .DatabindContext ;
7- import com .fasterxml .jackson .databind .introspect .AnnotatedConstructor ;
8-
93/**
104 * Configurable handler used to select aspects of selecting
115 * constructor to use as "Creator" for POJOs.
@@ -62,18 +56,6 @@ public enum SingleArgConstructor {
6256 REQUIRE_MODE ;
6357 }
6458
65- // @FunctionalInterface
66- /**
67- * Simple interface for optionally defined handler that can select
68- * specific Constructor to use if more than one implicitly detected ones
69- * (and no explicitly annotated one) found.
70- */
71- public interface ConstructorSelector {
72- public AnnotatedConstructor select (DatabindContext ctxt ,
73- List <AnnotatedConstructor > ctors )
74- throws IOException ;
75- }
76-
7759 /*
7860 /**********************************************************************
7961 /* Global default instances to use
@@ -85,9 +67,6 @@ public AnnotatedConstructor select(DatabindContext ctxt,
8567 *<ul>
8668 * <li>Uses {@link SingleArgConstructor#HEURISTIC} for single-argument constructor case
8769 * </li>
88- * <li>Does not specify {@link ConstructorSelector} to solve ambiguous
89- * (multiple implicitly discovered argument-taking Constructors}
90- * </li>
9170 * <li>Does not require explicit {@code @JsonCreator} annotations (so allows
9271 * auto-detection of Visible constructors} (except for JDK types)
9372 * </li>
@@ -128,8 +107,6 @@ public AnnotatedConstructor select(DatabindContext ctxt,
128107
129108 protected final SingleArgConstructor _singleArgMode ;
130109
131- protected final ConstructorSelector _selector ;
132-
133110 /**
134111 * Whether explicit {@link com.fasterxml.jackson.annotation.JsonCreator}
135112 * is always required for detecting constructors (even if visible) other
@@ -139,7 +116,7 @@ public AnnotatedConstructor select(DatabindContext ctxt,
139116
140117 /**
141118 * Whether auto-detection of constructors of "JDK types" (those in
142- * packages {@code java.} and {@code javax.}) is allowed or not (
119+ * packages {@code java.} and {@code javax.}) is allowed or not
143120 */
144121 protected final boolean _allowJDKTypeCtors ;
145122
@@ -150,12 +127,10 @@ public AnnotatedConstructor select(DatabindContext ctxt,
150127 */
151128
152129 protected ConstructorDetector (SingleArgConstructor singleArgMode ,
153- ConstructorSelector selector ,
154130 boolean requireCtorAnnotation ,
155131 boolean allowJDKTypeCtors )
156132 {
157133 _singleArgMode = singleArgMode ;
158- _selector = selector ;
159134 _requireCtorAnnotation = requireCtorAnnotation ;
160135 _allowJDKTypeCtors = allowJDKTypeCtors ;
161136 }
@@ -165,26 +140,21 @@ protected ConstructorDetector(SingleArgConstructor singleArgMode,
165140 * by {@code _singleArgMode}
166141 */
167142 protected ConstructorDetector (SingleArgConstructor singleArgMode ) {
168- this (singleArgMode , null , false , false );
143+ this (singleArgMode , false , false );
169144 }
170145
171146 protected ConstructorDetector withSingleArgMode (SingleArgConstructor singleArgMode ) {
172- return new ConstructorDetector (singleArgMode , _selector ,
173- _requireCtorAnnotation , _allowJDKTypeCtors );
174- }
175-
176- protected ConstructorDetector withSelector (ConstructorSelector selector ) {
177- return new ConstructorDetector (_singleArgMode , selector ,
147+ return new ConstructorDetector (singleArgMode ,
178148 _requireCtorAnnotation , _allowJDKTypeCtors );
179149 }
180150
181151 protected ConstructorDetector withRequireAnnotation (boolean state ) {
182- return new ConstructorDetector (_singleArgMode , _selector ,
152+ return new ConstructorDetector (_singleArgMode ,
183153 state , _allowJDKTypeCtors );
184154 }
185155
186156 protected ConstructorDetector withAllowJDKTypes (boolean state ) {
187- return new ConstructorDetector (_singleArgMode , _selector ,
157+ return new ConstructorDetector (_singleArgMode ,
188158 _requireCtorAnnotation , state );
189159 }
190160
@@ -198,10 +168,6 @@ public SingleArgConstructor singleArgMode() {
198168 return _singleArgMode ;
199169 }
200170
201- public ConstructorSelector constructorSelector () {
202- return _selector ;
203- }
204-
205171 public boolean requireCtorAnnotation () {
206172 return _requireCtorAnnotation ;
207173 }
0 commit comments