G'day
How does one - in CF - refer to an inner class (ClassFoo.Bar) of a given
class (ClassFoo), when the constructor of ClassFoo takes an argument of
type ClassFoo.Bar?
For example the first, third,fourth and fifth constructors shown here:
http://tinyurl.com/hfg9s (org.apache.lucene.document.Field).
Any ideas?

Signature
Adam
cf_dev2 - 25 Apr 2007 17:31 GMT
<cfscript>
bar = createObject("java", "org.apache.lucene.document.Field$Store");
foo = createObject("java", "org.apache.lucene.document.Field");
foo.init(name, byte, bar.COMPRESS);
</cfscript>
Adam Cameron - 26 Apr 2007 11:31 GMT
That did the trick: cheers.

Signature
Adam
insuractive - 25 Apr 2007 21:22 GMT
Just out of curiosity - what does the $ represent and is the reason you can't
use another "." because it is not a property of Field? I've never really done
anything with Java inner classes, but this seems like a syntax I'll want to
hang on to for future reference.
cf_dev2 - 25 Apr 2007 23:53 GMT
>is the reason you can't use another "." because it is not a property of Field
Thats my understanding, yes.
> what does the $ represent
Its part of the class name. It has to do with how java compiles the classes.
It creates one file for the outer class and one for the inner class. The naming
convention for inner class files is usually
"OuterClassName$InnerClassName.class". So the class name passed to
createObject() becomes
bar = createObject("java", "OuterClassName$InnerClassName");
insuractive - 26 Apr 2007 15:48 GMT
Thanks for the illumination, cf_dev2!