users@jaxb.java.net

RE: Re: Re: interface

From: Lulseged Zerfu <lulseged.zerfu_at_ericsson.com>
Date: Mon, 21 Jul 2008 14:27:42 +0200

Ok.

Let me try this way.

I want an interface class for each generated class.

For example for Watcher.java I want an interface called IWatcher.java to be generated.

And the generated Watcher.java should implement Iwatcher as below:

Class Watcher implements IWatcher
{
   .....
}


Lul

-----Original Message-----
From: Felipe Gaścho [mailto:fgaucho_at_gmail.com]
Sent: den 21 juli 2008 13:22
To: users_at_jaxb.dev.java.net
Subject: Re: Re: interface

I can't see how to represent interfaces in XSD ...

On Mon, Jul 21, 2008 at 1:17 PM, Lulseged Zerfu <lulseged.zerfu_at_ericsson.com> wrote:
> Thanks for your reply.
>
> Today's testing framworks like junit and mostly easymock need a collaborator. It is an interface. It is easy to create interfaces manually but the problem is I have to update everytime I generate java classes from a schema.
>
> I would propse this feature (generating interface for each generated class) for the JAXB team.
>
> All of my schemas have diffrent namespaces thus are separated in this context.
>
> Let's take a look at on one schema from IETF:
>
> When compiling this schema 5 java classes are generated.
> ObjectFactory.java,
> package-info.java,
> Watcher.java,
> Watcherinfo.java and
> WatcherList.java
>
> This is fine.
> I would like to customize the ObjectFactory class name to be called WatcherFactory.
>
> Lul
>
> -----Original Message-----
> From: Felipe Gaścho [mailto:fgaucho_at_gmail.com]
> Sent: den 21 juli 2008 11:27
> To: users_at_jaxb.dev.java.net
> Subject: Re: interface
>
>> Can JAXB generate interface classes?
>
> JAXB cannot bind interfaces out of the box, but you can find some dirty tricks here:
> https://jaxb.dev.java.net/guide/Mapping_interfaces.html
>
>
>> Can I customize the name "ObjectFactory"?
>
> the correct solution is to use namespaces to prevent naming
> conflicts.. (change the package and not the generated Types)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>