Skip to main content

How to extend different XMLElement classes from different base class

2 replies [Last post]
girixkumar
Offline
Joined: 2005-10-19

I know one can use superClass (xjc extension) appinfo element inside global globalBindings element to extend all the JAXB generated classes from a single class. However, I have not found a way to extend JAXB generated classes from different base classes.
E.g Say in my XML I have PurchaseOrder and Item elements. I want to extend PurchaseOrder JAXB generated class from PorchaseOrderBase and Item JAXB generated class from ItemBase.

Is there any extension that can help me achieve this? This would be a very common usecase I would presume.

Thank you very much for your help.
=Girish

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Glen Mazza

Yes, Lexi's Inheritance plugin
(http://confluence.highsource.org/display/J2B/Inheritance+plugin), or the
interface insertion plugin
(https://jaxb2-commons.dev.java.net/interface-insertion/) if you want to
extend an interface instead.

HTH,
Glen

metro-3 wrote:
>
> I know one can use superClass (xjc extension) appinfo element inside
> global globalBindings element to extend all the JAXB generated classes
> from a single class. However, I have not found a way to extend JAXB
> generated classes from different base classes.
> E.g Say in my XML I have PurchaseOrder and Item elements. I want to extend
> PurchaseOrder JAXB generated class from PorchaseOrderBase and Item JAXB
> generated class from ItemBase.
>
> Is there any extension that can help me achieve this? This would be a very
> common usecase I would presume.
>

--
View this message in context: http://metro.1045641.n5.nabble.com/How-to-extend-different-XMLElement-cl...
Sent from the Metro - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

casadelgato
Offline
Joined: 2010-05-17

Can anyone tell me where the inheritance plugin is now?

https://jaxb2-commons.dev.java.net/interface-insertion/

is no longer valid.