Annotation Type JacksonXmlProperty


@Target({ANNOTATION_TYPE,FIELD,METHOD,PARAMETER}) @Retention(RUNTIME) public @interface JacksonXmlProperty
Annotation that can be used to provide XML-specific configuration for properties, above and beyond what JsonProperty contains. It is mainly an alternative to using JAXB annotations.

Note that annotation may be used on

  • Fields
  • Setter and getter methods
  • Arguments (parameters) of "Creators" -- annotated constructors and/or static factory methods
but it can NOT be used on argument/parameter of setter methods (or rather while compiler allows that, will have no effect) -- setter method itself needs to be annotated.

Note that since 2.12 there is no need to use this property over JsonProperty just to define XML namespace, as @JsonProperty has namespace property.

  • Element Details

    • isAttribute

      boolean isAttribute
      Default:
      false
    • namespace

      String namespace
      Default:
      ""
    • localName

      String localName
      Default:
      ""