users@jaxb.java.net

Re: CodeModel : how to generate System.err.println()

From: Kohsuke Kawaguchi <Kohsuke.Kawaguchi_at_Sun.COM>
Date: Mon, 11 Dec 2006 15:00:48 -0800

Benoit Callebaut wrote:
> Hello,
> While working on my plugin I was blocked on the following problem.
>
> I converted the following statement into XML : System.out.println(...);
> It gives :
> < <invocation method="*println*">
> - <#> <namespace name="*err*">
> <namespace name="*System*" />
> </namespace>
> <argument type="*String*" value="*NameService did not start
> successfully"*" />
> </invocation>
>
> I travel the XML code recursively and I can generate the CodeModel
> elements while I enter the XML node or when I leave it.
>
> How can I generate the code model element for that snippet ?
> The problems are :
> 1) I don't know if "err" is a field of "System" or a class on which I
> can invoke the static method "println".
> 2) I don't know if "System" is a package or a class.
>
> Does it exist a way to query the CodeModel for such information ?

Not really. I think you'd have to ask whoever typing those XML to give
that to you.

But do you really want the person to be programming by using XML?

-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com