com.fasterxml.jackson.annotation

Annotation Type JsonAlias



  • @Target(value={ANNOTATION_TYPE,FIELD,METHOD,PARAMETER})
     @Retention(value=RUNTIME)
    public @interface JsonAlias
    Annotation that can be used to define one or more alternative names for a property, accepted during deserialization as alternative to the official name. Alias information is also exposed during POJO introspection, but has no effect during serialization where primary name is always used.

    Examples:

    public class Info {
      @JsonAlias({ "n", "Name" })
      public String name;
    }
    

    Since:
    2.9
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      String[] value
      One or more secondary names to accept as aliases to the official name.
    • Element Detail

      • value

        public abstract String[] value
        One or more secondary names to accept as aliases to the official name.
        Default:
        {}

Copyright © 2008–2019 FasterXML. All rights reserved.