users@jaxb.java.net

Re: getting rid of ^M characters in XJC generated .java files

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_sun.com>
Date: Thu, 24 Jul 2003 11:22:58 -0400

Mark D. Hansen wrote:

> Sorry if this is a dumb question, but how do I prevent XJC from using ^M for newline so that
> my JAXB generated .java files look better in Windows?
>

Our code generator is using PrintWriter which always uses the system line.separator
property ("\r\n" on Windows). The only editor on my Windows system that displayed
the CR as a ^M was XEmacs.

We did find a small problem with the way that we produce the file prolog comments
( "// This file was generated by..." ), but it's now fixed. We were explicitly
printing a '\n' which is handled differently by some editors ( notepad -vs- wordpad
for example).

--Ryan

> Thanks,
>
> Mark
>
>