users@jaxb.java.net

Re: Re: unable to use the jaxb2-basics plugin

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Thu, 25 Aug 2011 09:09:28 +0200

Hi,


> Sure would be nice if those files actually showed up in a google
> search.
> They don't.

http://www.google.com/search?q=jaxb2-basics+0.6.2, first link

> So, I downloaded those, and all their dependencies. (23 files files
> manually installed to my local Maven repository)
> It works!

I'm not sure why you had to download it manually. It's a central maven
repo - are you, like, downloading everything from the central repo
manually? Sounds a bit weird. Even behind firewalls/Nexus central repo
is normally just proxied. So it should work without any adjustments.

> Now, if it was just documented.
> At all.
> I thought it would be generating relatively simple
> equals/tostring/etc...
> So, it generates rather odd looking methods that use Strategies on each
> call.

Correct.

> Is there any documentation on just what these strategies do?

Isn't it obvious from interfaces/implementation? What would you expect
this method to do? :)

public interface CopyStrategy {

        public boolean copy(ObjectLocator locator, boolean value);
...
}


Anyway, with "normal" usage (just toString(), equals(...), hashCode())
you don't need to mess with strategies at all. You only need
strategies if you want to do some "custom" object comparison. For
instance, if you want to know, where exactly two objects differ, you
can achieve this with a custom strategy.

> Is there any way to exclude certain fields?

Yes, see here:

http://confluence.highsource.org/display/J2B/JAXB2+Basics+Plugins

See test projects as well.

> I've found their source - which is pretty much undocumented.  And no,
> it's not a trivial thing to figure out exactly what they do.

I understand your point with the documentation. You are right, the
code could have been better documented, but I do not have resources to
do this. This is an open-source project, however, so if it is an issue
for you, you are welcome to join the project and contribute the
documentation.

It also seems to me that you missed some docs here:

http://confluence.highsource.org/display/J2B/JAXB2+Basics+Plugins

Bye,
/lexi