users@jaxb.java.net

RE: Re: Binding file question

From: Glen Verran <glen.verran_at_traderoot.com>
Date: Mon, 5 May 2008 08:54:46 +0200

Hi there,

I extend the super class this way:

<xsd:annotation>
   <xsd:appinfo>
      <jaxb:globalBindings>
          <xjc:superClass name="com.company.module.SuperClass"/>
      </jaxb:globalBindings>
   </xsd:appinfo>
</xsd:annotation>

Which works 100%. This is the only method I know.

~Glen

-----Original Message-----
From: alecswan [mailto:aukcioner_at_yahoo.com]
Sent: 02 May 2008 20:06
To: users_at_jaxb.dev.java.net
Subject: Re: Binding file question


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.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net