This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 102149 - Method to create a Tree for an arbitrary type while handling imports
Summary: Method to create a Tree for an arbitrary type while handling imports
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Source (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker (vote)
Assignee: Rastislav Komara
Depends on:
Reported: 2007-04-23 14:10 UTC by Andrei Badea
Modified: 2009-02-03 10:56 UTC (History)
0 users

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description Andrei Badea 2007-04-23 14:10:09 UTC
I need to create a Tree for an arbitrary type given as a string using
fully-qualified names and use this tree to generate Java code in such a way that
imports are handled. If I understand correctly the current way to handle imports
is to use TreeMaker.QualIdent(). This method gets an Element, but there is no
simple way to get an Element for any type. There is TreeUtilities.parseType(),
but it returns a TypeMirror.

I recall we agreed to introduce a TreeMaker.Tree(String typeName) method which
would do just this. Such a solution would have the disadvantage that the client
can't choose not to have imports handled, but that's not my case and I would be
happy with such a solution.
Comment 1 Rastislav Komara 2009-02-03 10:56:40 UTC