users@jaxb.java.net

Re: Binding file question

From: alecswan <aukcioner_at_yahoo.com>
Date: Fri, 2 May 2008 11:06:24 -0700 (PDT)

Is there a simpler way in JAXB 2.0 to force a particular generated class to
extend the given class?

I would expect something like this:

<jaxb:globalBindings>
                <jaxb:superClass name="SuperClass" xmlType="myns:SomeXmlType"/>
</jaxb:globalBindings>



Ed Mooney wrote:
>
> Hi Lucas,
>
> Your external binding file needs to specify the location in your schema
> for applying the customizations, using XPath. In the case of
> globalBindings, this is usually something like:
>
> <jxb:bindings schemaLocation="your_schema.xsd" node="/xs:schema">
> <jxb:globalBindings ...> ... </> ... </>
>
> @node specifies the location. Please see the external-customize sample.
>
> -- Ed
>
> Lucas Jordan wrote:
>> Thank you.
>> I have found that adding:
>> <xsd:annotation>
>> <xsd:appinfo>
>> <jxb:globalBindings>
>> <jxb:javaType name="java.util.Calendar"
>> xmlType="xsd:dateTime"
>> parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
>> printMethod="javax.xml.bind.DatatypeConverter.printDate"
>> />
>> </jxb:globalBindings>
>> </xsd:appinfo>
>> </xsd:annotation>
>>
>> To my xsd document does change XMLGreCal to Calendar. I am not yet able
>> to
>> create a binding file that does the same thing: here is my best guess,
>> mind
>> you it does not even seem to be valid, so I guess it's not a good guess:
>>
>> <bindings xmlns='http://java.sun.com/xml/ns/jaxb'
>> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
>> xmlns:xs='http://www.w3.org/2001/XMLSchema'
>> xmlns:as='http://stuff'
>> xsi:schemaLocation='http://java.sun.com/xml/ns/jaxb
>> http://java.sun.com/xml/ns/jaxb/bindingschema_2_0.xsd'
>> version='2.0'>
>>
>> <globalBindings>
>> <javaType name="java.util.Calendar" xmlType="xs:dateTime"
>> parseMethod="javax.xml.bind.DatatypeConverter.parseDate"
>> printMethod="javax.xml.bind.DatatypeConverter.printDate" />
>> </globalBindings>
>>
>> </bindings>
>>
>>
>> What an I missing?
>> Thank you,
>> Lucas
>>
> [ ... ]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
>

-- 
View this message in context: http://www.nabble.com/Extends-implements-tp2469659p17024902.html
Sent from the java.net - jaxb users mailing list archive at Nabble.com.