@@ -687,35 +687,17 @@ public JavaType moreSpecificType(JavaType type1, JavaType type2)
687
687
}
688
688
return type1 ;
689
689
}
690
-
690
+
691
691
/*
692
692
/**********************************************************
693
- /* Public factory methods
693
+ /* Public general-purpose factory methods
694
694
/**********************************************************
695
695
*/
696
696
697
697
public JavaType constructType (Type type ) {
698
698
return _fromAny (null , type , EMPTY_BINDINGS );
699
699
}
700
700
701
- /**
702
- * Method that you very likely should NOT be using -- you need to know a lot
703
- * about internal details of {@link TypeBindings} and even then it will probably
704
- * not do what you want.
705
- * Usually you would instead want to call one of {@code constructXxxType()}
706
- * methods (where {@code Xxx} would be "Array", "Collection[Like]", "Map[Like]"
707
- * or "Parametric").
708
- */
709
- public JavaType constructType (Type type , TypeBindings bindings ) {
710
- // 15-Jun-2020, tatu: To resolve (parts of) [databind#2796], need to
711
- // call _fromClass() directly if we get `Class` argument
712
- if (type instanceof Class <?>) {
713
- JavaType resultType = _fromClass (null , (Class <?>) type , bindings );
714
- return _applyModifiers (type , resultType );
715
- }
716
- return _fromAny (null , type , bindings );
717
- }
718
-
719
701
public JavaType constructType (TypeReference <?> typeRef )
720
702
{
721
703
// 19-Oct-2015, tatu: Simpler variant like so should work
@@ -740,6 +722,53 @@ public JavaType constructType(TypeReference<?> typeRef)
740
722
*/
741
723
}
742
724
725
+ /**
726
+ * Method to call when resolving types of {@link java.lang.reflect.Member}s
727
+ * like Fields, Methods and Constructor parameters and there is a
728
+ * {@link TypeBindings} (that describes binding of type parameters within
729
+ * context) to pass.
730
+ * This is typically used only by code in databind itself.
731
+ *
732
+ * @param type Type of a {@link java.lang.reflect.Member} to resolve
733
+ * @param bindings Type bindings from the context, often class in which
734
+ * member declared but may be subtype of that type (to bind actual bound
735
+ * type parametrers). Not used if {@code type} is of type {@code Class<?>}.
736
+ *
737
+ * @return Fully resolve type
738
+ *
739
+ * @since 2.12 as replacement for deprecated {@link #constructType(Type, TypeBindings)}
740
+ */
741
+ public JavaType resolveMemberType (Type type , TypeBindings contextBindings ) {
742
+ return _fromAny (null , type , contextBindings );
743
+ }
744
+
745
+ /*
746
+ /**********************************************************
747
+ /* Deprecated public factory methods
748
+ /**********************************************************
749
+ */
750
+
751
+ /**
752
+ * Method that you very likely should NOT be using -- you need to know a lot
753
+ * about internal details of {@link TypeBindings} and even then it will probably
754
+ * not do what you want.
755
+ * Usually you would instead want to call one of {@code constructXxxType()}
756
+ * methods (where {@code Xxx} would be "Array", "Collection[Like]", "Map[Like]"
757
+ * or "Parametric").
758
+ *
759
+ * @deprecated Since 2.12
760
+ */
761
+ @ Deprecated // since 2.12
762
+ public JavaType constructType (Type type , TypeBindings bindings ) {
763
+ // 15-Jun-2020, tatu: To resolve (parts of) [databind#2796], need to
764
+ // call _fromClass() directly if we get `Class` argument
765
+ if (type instanceof Class <?>) {
766
+ JavaType resultType = _fromClass (null , (Class <?>) type , bindings );
767
+ return _applyModifiers (type , resultType );
768
+ }
769
+ return _fromAny (null , type , bindings );
770
+ }
771
+
743
772
/**
744
773
* @deprecated Since 2.7 (accidentally removed in 2.7.0; added back in 2.7.1)
745
774
*/
0 commit comments