java - Do a global binding to any type that has a specified base restriction -


this question has answer here:

i wish bind adapter type has restriction base xs:long, how can achieve this? wish global binding in way, couldn't find understandable documentation.

<xs:simpletype name="st_type"> <xs:restriction base="xs:long">     <xs:mininclusive value="0" />     <xs:maxinclusive value="9999999999" /> </xs:restriction> </xs:simpletype> 

and binding logic below;

<jaxb:bindings schemalocation="simpletypes.xsd"> <jaxb:bindings node="xs:simpletype[@base='xs:long']">     <xjc:javatype name="java.lang.long"                    adapter="**.longadapter"/> </jaxb:bindings> </jaxb:bindings> 

i tried syntax above, @base not defined , have define each type has xs:long base 1 one, there no way global binding? thanks.

awkward answer own question solution pretty easy...

<jaxb:globalbindings>     <xjc:javatype name="java.lang.long"             xmltype="xs:long"             adapter="**.adapters.longadapter" />     <xjc:javatype name="java.lang.integer"             xmltype="xs:integer"             adapter="**.adapters.integeradapter" /> </jaxb:globalbindings> 

Comments