Annotation Type JsonApplyView


  • @Target({ANNOTATION_TYPE,CONSTRUCTOR,FIELD,METHOD})
    @Retention(RUNTIME)
    public @interface JsonApplyView
    Annotation used for specifying view that should be used to process the property that is defined by method or field annotated.

    An example annotation would be:

      @JsonApplyView(BasicView.class)
      public MyValue value;
    
    which specifies that the property annotated (and nested values reach through it) would be processed using View identified by BasicView.class.

    It is also possible to disable View processing for given property by:

      @JsonApplyView(JsonApplyView.NONE.class)
      public MyValue fullValue;
    
    which similarly applies to properties reachable via fullValue.

    Note: initially processing only covers serialization.

    Since:
    2.22
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      java.lang.Class<?> value
      View that should be used to process annotated property, if any; special value JsonApplyView.NONE indicates that no View should used.
    • Element Detail

      • value

        java.lang.Class<?> value
        View that should be used to process annotated property, if any; special value JsonApplyView.NONE indicates that no View should used.