Annotation Interface XmlAttribute


@Retention(RUNTIME) public @interface XmlAttribute
Instructs the parser to treat the field as an attribute in XML. This annotation works for both serialization as deserialization
 
     class Pojo {
         \@XmlAttribute
         public String name = "Hello";
     }
 
 
Turns into:
 
     <Pojo name="Hello"></Pojo>
 
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details

    • pattern

      String pattern
      Default:
      ""