jastrachan | 15 Apr 16:40 2004
Picon

Re: documentation frustration

On 15 Apr 2004, at 15:29, Will Schenk wrote:
>> However in the mean time a simple workaround is
>>
>> out = new File( "out.xml" ).newPrintWriter();
>> new MarkupBuilder( out );
>>
>>> More to the point, how am I supposed to know that a particular groovy
>>> class
>>> reference is even different from it's eponymic java class?
>
>> Its not - its the same Java JDK class
>
> There is no File.newPrintWriter() method in the JDK

note you could have just used

     new PrintWriter(new FileWriter(new File("foo.txt")))
instead

>  -- but a search through the
> source explains my confusion: it's implemented in the monster 
> method-bucket
> class org.codehaus.groovy.runtime.DefaultGroovyMethods, not as some 
> sort of
> facade over java.io.File.  Which makes more sense, I suppose, but 
> geez, that's
> a big file.

The new methods we add to the JDK are described here...

http://groovy.codehaus.org/groovy-jdk.html

which is described in the language guide
http://groovy.codehaus.org/guide.html

though there's a current quirk in the document generator that excludes 
java.io.File. We're working on fixing that.

James
-------
http://radio.weblogs.com/0112098/

Gmane