users@jaxb.java.net

Re: problem in enum generated from simple type

From: Wolfgang Laun <wolfgang.laun_at_gmail.com>
Date: Mon, 10 May 2010 15:01:28 +0200

The following customization results in the enum constant being
   submitGraniteCmplRequest
rather than
   SUBMIT_GRANITE_CMPL_REQUEST:

    <xs:enumeration value="submitGraniteCmplRequest">
        <xs:annotation><xs:appinfo>
           <jaxb:typesafeEnumMember name = "submitGraniteCmplRequest"/>
        </xs:appinfo></xs:annotation>
    </xs:enumeration>

I think that this can be easily added to the XML Schema using XSLT, since
the value of the "name" is just the value of the "value" attribute from the
xs:enumeration.

-W


On Mon, May 10, 2010 at 12:23 PM, Rochak Gupta <rochak005_at_gmail.com> wrote:

> Hi Team,
>
>
>
> We are upgrading from jaxb1 and jaxb2 . So we are facing a problem that:
>
>
>
> While generating an enum class from respective simpletype element we are
> getting enum clases with underscores for example
>
>
>
> Problematic simpletype:
>
>
>
> <xs:simpleType name="MessageNameType">
>
> <xs:restriction base="xs:string">
>
> <xs:enumeration value="submitGraniteCmplRequest"/>
>
> <xs:enumeration value="submitGraniteCmplResponse"/>
>
> <xs:enumeration value="reserveNambisIPRequest"/>
>
> <xs:enumeration value="releaseNambisIPRequest"/>
>
> <xs:enumeration value="notifyNambisIPResponse"/>
>
> <xs:enumeration value="getCmiSubscription"/>
>
> <xs:enumeration value="cmiSubscriptionDetails"/>
>
> <xs:enumeration value="cancelCmiInterception"/>
>
> <xs:enumeration value="completeCmiInterception"/>
>
> <xs:enumeration value="pingCmi"/>
>
> <xs:enumeration value="pingCmiResult"/>
>
> </xs:restriction>
>
> </xs:simpleType>
>
>
>
> Now in Jaxb1 we were getting enum class as submitGraniteCmplRequest now we
> are getting submit_GraniteCmpl_Request , ie difference of underscores .
> and thus breaking our code . Is there any way,that same enum class can be
> generated ie. without underscores..?? . I am attaching my xsd’ herewith
>
> Thanks and regards,
>
> Rochak
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>