コード例 #1
0
 @Override
 public JsonInclude.Include findSerializationInclusion(Annotated a, JsonInclude.Include defValue) {
   JsonInclude inc = _findAnnotation(a, JsonInclude.class);
   if (inc != null) {
     return inc.value();
   }
   JsonSerialize ann = _findAnnotation(a, JsonSerialize.class);
   if (ann != null) {
     @SuppressWarnings("deprecation")
     JsonSerialize.Inclusion i2 = ann.include();
     switch (i2) {
       case ALWAYS:
         return JsonInclude.Include.ALWAYS;
       case NON_NULL:
         return JsonInclude.Include.NON_NULL;
       case NON_DEFAULT:
         return JsonInclude.Include.NON_DEFAULT;
       case NON_EMPTY:
         return JsonInclude.Include.NON_EMPTY;
       case DEFAULT_INCLUSION: // since 2.3 -- fall through, use default
         break;
     }
   }
   return defValue;
 }
コード例 #2
0
 @Override
 public JsonInclude.Include findSerializationInclusionForContent(
     Annotated a, JsonInclude.Include defValue) {
   JsonInclude inc = _findAnnotation(a, JsonInclude.class);
   return (inc == null) ? defValue : inc.content();
 }