com.fasterxml.jackson.annotation

Annotation Type JsonAutoDetect



  • @Target(value={ANNOTATION_TYPE,TYPE})
    @Retention(value=RUNTIME)
    public @interface JsonAutoDetect
    Class annotation that can be used to define which kinds of Methods are to be detected by auto-detection, and with what minimum access level. Auto-detection means using name conventions and/or signature templates to find methods to use for data binding. For example, so-called "getters" can be auto-detected by looking for public member methods that return a value, do not take argument, and have prefix "get" in their name.

    Default setting for all accessors is JsonAutoDetect.Visibility.DEFAULT, which in turn means that the global defaults are used. Defaults are different for different accessor types (getters need to be public; setters can have any access modifier, for example). If you assign different JsonAutoDetect.Visibility type then it will override global defaults: for example, to require that all setters must be public, you would use:

       @JsonAutoDetect(setterVisibility=Visibility.PUBLIC_ONLY)
    

    • Element Detail

      • getterVisibility

        public abstract JsonAutoDetect.Visibility getterVisibility
        Minimum visibility required for auto-detecting regular getter methods.
        Default:
        com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.DEFAULT
      • isGetterVisibility

        public abstract JsonAutoDetect.Visibility isGetterVisibility
        Minimum visibility required for auto-detecting is-getter methods.
        Default:
        com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.DEFAULT
      • setterVisibility

        public abstract JsonAutoDetect.Visibility setterVisibility
        Minimum visibility required for auto-detecting setter methods.
        Default:
        com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.DEFAULT
      • creatorVisibility

        public abstract JsonAutoDetect.Visibility creatorVisibility
        Minimum visibility required for auto-detecting Creator methods, except for no-argument constructors (which are always detected no matter what).
        Default:
        com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.DEFAULT
      • fieldVisibility

        public abstract JsonAutoDetect.Visibility fieldVisibility
        Minimum visibility required for auto-detecting member fields.
        Default:
        com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.DEFAULT

Copyright © 2008–2016 FasterXML. All rights reserved.