0

马文:

<execution>
 <id>cdm-generate-Oracle</id>

  <goals>
     <goal>
        generate</goal>
  </goals>

 <configuration>

     <schemaDirectory>src\main\resources\xsd\clients</schemaDirectory>
     <verbose>true</verbose>

        <schemaIncludes>
          <include>*.xsd</include>          

        </schemaIncludes>

        <bindingDirectory>src\main\resources\xsd\clients</bindingDirectory>

        <bindingIncludes>
            <bindingInclude>*.xjb</bindingInclude>
        </bindingIncludes>

        <generatePackage>com.adp.smartconnect.client.oraclecloud</generatePackage>

        <clearOutputDir>true</clearOutputDir>
        <generateDirectory>src/main/java</generateDirectory>
 </configuration>

 </execution>

XSD:

    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                targetNamespace="http://www.adp.com/smartclound/v0.9"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                          xmlns:xoracle="http://www.adp.com/smartclound/v0.9" elementFormDefault="qualified">
            <xsd:element name="DATA_DS">
            <xsd:complexType mixed="true">
                <xsd:sequence>
                    <xsd:element name="ARCHIVEPACTID" minOccurs="0" type="xsd:int"/>
                    <xsd:element name="DELIVERYOPTIONID" minOccurs="0" type="xsd:long"/>
                    <xsd:element name="PAYROLLACTIONID" minOccurs="0" type="xsd:int"/>
                    <xsd:element name="G_1" minOccurs="0">
                        <xsd:complexType mixed="true">
                            <xsd:sequence>
                                <xsd:element name="FILE_FRAGMENT" minOccurs="0">
                                    <xsd:complexType mixed="true">
                                        <xsd:sequence>
                                            <xsd:element name="PAYSLIP" minOccurs="0">
                                                <xsd:complexType mixed="true">
                                                    <xsd:sequence>
                                                      <xsd:element name="REP_CATEGORY_NAME"
                                                      minOccurs="0" type="xsd:normalizedString"/>
                                                      <xsd:element name="parameters" minOccurs="0">
                                                      <xsd:complexType mixed="true">
                                                      <xsd:sequence>
                                                      <xsd:element name="request_id" minOccurs="0"
                                                      type="xsd:long"/>
                                                      <xsd:element name="FLOW_NAME" minOccurs="0"
                                                      type="xsd:string"/>

捆绑 :

    <jaxb:bindings version="2.1"
               xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
               xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <jaxb:bindings schemaLocation="file:/C:/Murali-CDM/src/main/resources/xsd/clients/USOnlinePayslip_GSE_R9_062415.xsd"  node="/xs:schema">
          <jaxb:globalBindings generateElementProperty="false"/>
       </jaxb:bindings>
    </jaxb:bindings> 

生成的类:

    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "content"
    })
    @XmlRootElement(name = "DATA_DS")
    public class DATADS {

        @XmlElementRefs({
            @XmlElementRef(name = "ARCHIVEPACTID", namespace = "http://www.adp.com/smartclound/v0.9", type = JAXBElement.class, required = false),
            @XmlElementRef(name = "DELIVERYOPTIONID", namespace = "http://www.adp.com/smartclound/v0.9", type = JAXBElement.class, required = false),
            @XmlElementRef(name = "G_1", namespace = "http://www.adp.com/smartclound/v0.9", type = JAXBElement.class, required = false),
            @XmlElementRef(name = "PAYROLLACTIONID", namespace = "http://www.adp.com/smartclound/v0.9", type = JAXBElement.class, required = false)
        })
        @XmlMixed
        protected List<Serializable> content;
    ================================

问题:尝试从 xsd 生成 JAXB 对象。xjc 插件正在生成 JAXBElements 。我正在尝试使用绑定摆脱 JAXBElement 生成。不成功 ?我的绑定有什么问题?

4

0 回答 0