JAXB Documentation Annotation

前端 未结 2 462
梦如初夏
梦如初夏 2021-01-17 17:15

I have the following java class with the JAXB @XMLRootElement annotation

@XmlRootElement(name=\"ClientData\")
public class ClientData {

/**
 * The first add         


        
相关标签:
2条回答
  • 2021-01-17 17:40

    Simple answer: no it's not possible with builtin JAXB.

    0 讨论(0)
  • 2021-01-17 17:50

    I don't know if it's possible, since I've never used it. But as far as I can tell the API doesn't support the documentation element. However, you could use the @XMLElement annotation to give your member a more descriptive name.

    //Example: Code fragment
    public class USPrice {
       @XmlElement(name="itemprice")
       public java.math.BigDecimal price;
    }
    
    <!-- Example: Local XML Schema element -->
    <xs:complexType name="USPrice"/>
       <xs:sequence>
         <xs:element name="itemprice" type="xs:decimal" minOccurs="0"/>
       </sequence>
    </xs:complexType>
    
    0 讨论(0)
提交回复
热议问题