Michael Hunger
added a comment - 27/Aug/10 1:43 AM perhaps it would be possible to construct such a type not just from a string - all the parsing in JavaType is already very fragile but by doing.
enclosing=new JavaType("com.foo.Enclosing");
inner=new JavaType("com.foo.Enclosing.Inner",....,enclosing);
i.e. explicitely providing the enclosing classes and using them as reference when doing:
getEnclosingClass()
getSimpleName()
imports
getFQN -> should that return a name with Enclosing$Inner or Enclosing.Inner ??? -> depends on usage in sourcecode or class file loading -> I'd rather go with the latter

Ben Alex
added a comment - 01/Sep/10 7:42 PM Michael, would you be able to provide a sample .java source file that Roo is unable to parse? Also if you had a chance to prepare a patch I'd be happy to apply it. Thanks.

parsing is just one problem that occurs in the roo notification system
the others are:
creating and using such java-types to create CID or ITDs
having them imported by the import-resolver (automatically)

If you'd like to I can spend some time to provide some patches. Although I fear it won't be simple to fix the Java-Parser.

Michael Hunger
added a comment - 02/Sep/10 2:27 PM a sample source is simple:
somewhere else
@interface Graph {
@interface Entity {}
}
@Graph.Entity // first problem
class Person {
Map.Entry entry; // second problem
}
another problem is also creating such JavaTypes with inner classes
parsing is just one problem that occurs in the roo notification system
the others are:
creating and using such java-types to create CID or ITDs
having them imported by the import-resolver (automatically)
If you'd like to I can spend some time to provide some patches. Although I fear it won't be simple to fix the Java-Parser.
Michael

Michael, I am having trouble reproducing the problem. First of all I should say the inner type support isn't something I've ever aimed to make work completely in Roo. The only strict legal requirement is Roo can parse legal .java files. Support for creating .java source and ITD source that uses or refers to inner types is not on the roadmap for now. You can emit .java source code manually (see addon-gwt for another add-on doing this) if this represents a major inconvenience.

Ben Alex
added a comment - 02/Oct/10 8:24 PM Michael, I am having trouble reproducing the problem. First of all I should say the inner type support isn't something I've ever aimed to make work completely in Roo. The only strict legal requirement is Roo can parse legal .java files. Support for creating .java source and ITD source that uses or refers to inner types is not on the roadmap for now. You can emit .java source code manually (see addon-gwt for another add-on doing this) if this represents a major inconvenience.
Anyhow, here is my .java source:
package com.foo;
import java.util.Map;
@Graph.Entity
public class Hello {
Map.Entry entry = null;
}
The annotation parses as I would expect:
FQTN.......: com.foo.Graph.Entity
Simple name: Entity
Package....: com.foo
Similarly the Map field parses as I would expect:
FQTN.......: java.util.Map.Entry
Simple name: Entry
Package....: java.util
Do you mind if I close this ticket?