users@jaxb.java.net

Reducing number of Generated classes

From: Martin Bosak <bosakm_java_at_fmctc.com>
Date: Thu, 16 Oct 2003 15:16:45 -0500

Hi,

The schema I am using (the IFX v 1.4.0 schema) always declares everything as
a XSD type (Simple or Complex) and then declares elements to be of that
type. This results in both a generated 'Type' and 'Element' interfaces
(along with the \impl classes as well). Is there a binding option for XJC
to reduce this?

For example, the following fragments:

 <xsd:complexType name="SignonRq_Type">
  <xsd:sequence>
   <xsd:choice minOccurs="0">
    <xsd:element ref="SignonPswd"/>
    <xsd:element ref="SignonCert"/>
    <xsd:element ref="SignonTransport"/>
    <xsd:element ref="SignonMagPIN"/>
    <xsd:element ref="SessKey"/>
  </xsd:choice>
  <xsd:element ref="SignonOverride" minOccurs="0"/>
  <xsd:element ref="ClientDt"/>
  <xsd:element ref="CustLangPref"/>
  <xsd:element ref="ClientApp"/>
  <xsd:element ref="ProxyClient" minOccurs="0"/>
  <xsd:element ref="EU.Cur" minOccurs="0"/>
  <xsd:element ref="SuppressEcho" minOccurs="0"/>
</xsd:sequence>
<xsd:attribute name="Id" type="xsd:ID"/>
</xsd:complexType>
...
<xsd:element name="SignonRq" type="SignonRq_Type"/>
...


Result in the following classes:
SignonRq_Type
SignonRqElement

and in the \impl directory, these classes are generated:
SignonRq_TypeImpl
SignonRqElementImpl

Here are my current schema bindings:
 <xsd:annotation>
  <xsd:appinfo>
   <jaxb:globalBindings underscoreBinding="asCharInWord"
        typesafeEnumBase="tns:ClosedEnum tns:OpenEnum"
        typesafeEnumMemberName="generateName">
   <xjc:serializable uid="12343"/>
   <jaxb:javaType name="int" xmlType="xsd:long"
         parseMethod="javax.xml.bind.DatatypeConverter.parseInt"
         printMethod="javax.xml.bind.DatatypeConverter.printInt"/>
   <jaxb:javaType name="boolean" xmlType="Boolean"

parseMethod="com.aciworldwide.base24.ifx.jaxb.IFXBoolean.parseBoolean"

printMethod="com.aciworldwide.base24.ifx.jaxb.IFXBoolean.printBoolean"/>
  <jaxb:javaType name="java.util.Calendar" xmlType="DateTime"

parseMethod="com.aciworldwide.base24.ifx.jaxb.IFXDateTime.parseDateTime"

printMethod="com.aciworldwide.base24.ifx.jaxb.IFXDateTime.printDateTime"/>
 </jaxb:globalBindings>
 <jaxb:schemaBindings>
    <jaxb:package name="com.aciworldwide.base24.ifx.schema.v1_4_0"/>
    <jaxb:nameXmlTransform>
        <jaxb:elementName suffix="Element"/>
   </jaxb:nameXmlTransform>
 </jaxb:schemaBindings>
</xsd:appinfo>
</xsd:annotation>


Thanks,
Marty


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net