Closed Hubbitus closed 5 years ago
My intention provide bindings allowing me generate class annotations from XML annotation .
For example by default class generated like:
/** * Attachment document. * * <p>Java class for TAttachment complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * <complexType name="TAttachment"> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> * <element name="desc" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/> * <element name="fileDesc" type="{http://rosreestr.ru/services/v0.1/commons/Documents}TFileDesc" minOccurs="0"/> * <element name="receivedInPaper" type="{http://rosreestr.ru/services/v0.1/commons/Documents}TReceivedInPaper" minOccurs="0"/> * </sequence> * </restriction> * </complexContent> * </complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.PROPERTY) @XmlType(name = "TAttachment", namespace = "http://rosreestr.ru/services/v0.1/commons/Documents", propOrder = { "desc", "fileDesc", "receivedInPaper" }) public class TAttachment{
This is generated from xsd fragment like:
<xs:complexType name="TAttachment"> <xs:annotation> <xs:documentation>Attachment document.</xs:documentation> </xs:annotation> <xs:sequence> ...
I want have Attachment document. available at runtime, so generate class like:
Attachment document.
@Documentation("Attachment document.") @XmlAccessorType(XmlAccessType.PROPERTY) @XmlType(name = "TAttachment", namespace = "http://rosreestr.ru/services/v0.1/commons/Documents", propOrder = { "desc", "fileDesc", "receivedInPaper" }) public class TAttachment{
That required for classes and properties.
I've wrote my XJC-plugin exactly for that purpose.
This is the right approach. :)
My intention provide bindings allowing me generate class annotations from XML annotation.
For example by default class generated like:
This is generated from xsd fragment like:
I want have
Attachment document.
available at runtime, so generate class like:That required for classes and properties.