File tree 3 files changed +39
-0
lines changed
src/main/java/com/fasterxml/jackson/databind
3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 1
1
package com .fasterxml .jackson .databind .introspect ;
2
2
3
+ import java .util .Collections ;
3
4
import java .util .Iterator ;
5
+ import java .util .List ;
4
6
5
7
import com .fasterxml .jackson .annotation .JsonInclude ;
6
8
@@ -284,4 +286,15 @@ public String findReferenceName() {
284
286
* @since 2.5
285
287
*/
286
288
public abstract JsonInclude .Value findInclusion ();
289
+
290
+ /**
291
+ * Method for finding all aliases of the property, if any.
292
+ *
293
+ * @return {@code List} of aliases, if any; never null (empty list if no aliases found)
294
+ *
295
+ * @since 2.17
296
+ */
297
+ public List <PropertyName > findAliases () {
298
+ return Collections .emptyList ();
299
+ }
287
300
}
Original file line number Diff line number Diff line change @@ -843,6 +843,19 @@ public JsonInclude.Value findInclusion() {
843
843
return (v == null ) ? JsonInclude .Value .empty () : v ;
844
844
}
845
845
846
+ // since 2.17
847
+ @ Override
848
+ public List <PropertyName > findAliases () {
849
+ AnnotatedMember ann = getPrimaryMember ();
850
+ if (ann != null ) {
851
+ List <PropertyName > propertyNames = _annotationIntrospector .findPropertyAliases (ann );
852
+ if (propertyNames != null ) {
853
+ return propertyNames ;
854
+ }
855
+ }
856
+ return Collections .emptyList ();
857
+ }
858
+
846
859
public JsonProperty .Access findAccess () {
847
860
return fromMemberAnnotationsExcept (new WithMember <JsonProperty .Access >() {
848
861
@ Override
Original file line number Diff line number Diff line change 2
2
3
3
import java .util .Collections ;
4
4
import java .util .Iterator ;
5
+ import java .util .List ;
5
6
6
7
import com .fasterxml .jackson .annotation .JsonInclude ;
7
8
@@ -218,6 +219,18 @@ public JsonInclude.Value findInclusion() {
218
219
return _inclusion ;
219
220
}
220
221
222
+ @ Override // since 2.17
223
+ public List <PropertyName > findAliases () {
224
+ AnnotatedMember ann = getPrimaryMember ();
225
+ if (ann != null ) {
226
+ List <PropertyName > propertyNames = _annotationIntrospector .findPropertyAliases (ann );
227
+ if (propertyNames != null ) {
228
+ return propertyNames ;
229
+ }
230
+ }
231
+ return Collections .emptyList ();
232
+ }
233
+
221
234
/*
222
235
/**********************************************************
223
236
/* Access to accessors (fields, methods etc)
You can’t perform that action at this time.
0 commit comments