Getting all the members (variables, methods AND method bodies) of a java source file

For a project I want to programmatically get access to the members of java source file (member variables, methods etc) as well as to the source code of those members. My question is what is the best method for this? So far I have found the following methods:
Use AST's provided by the Java Source API and Java Tree API, as discussed in the following posts:
http://today.java.net/pub/a/today/2008/04/10/source-code-analysis-using-java-6-compiler-apis.html
http://weblogs.java.net/blog/timboudreau/archive/2008/02/see_java_code_t.html
http://netbeans.dzone.com/announcements/new-class-visualization-module
This has the disadvantage that the classes actually have to be compilable. When I look at the Netbeans Navigator view however, it provides me with a nicely formatted UI list, regardless of the "compilable" state of the class.
Thus I started looking at how to do this... The answer appears to be through the use of tools such as JavaCC: https://javacc.dev.java.net/
ANTLR: http://www.antlr.org/
which are lexers and parsers of source code. However, since the Navigator panel already does this, couldn't I use part of this code to get me the list of variables and methods in a source file? Does the Navigator API help in this regard?
Another route seems to be through tools such as
BeautyJ: http://beautyj.berlios.de/
which run on top of JavaCC if I am correct, and which has the ability to provide a clean view on your java code (or an XML view). However, BeautyJ does not seem to be too actively developed, and is only j2se1.4 compatible.
I hope someone can shed a light on the best way to go about what I want to achieve. Somebody already doing this?
(I crossposted on the Netbeans forums too, hope this is OK...)

I'm currently developing a LaTeX editor(MDI) and I do the same thing, but I don't know what exactly do you need.

Similar Messages

  • [svn:osmf:] 13042: Fix for FM-287, reinstating the main sample ( that uses serial and parallel composition), and making another pass at  getting all the changed trait methods mapped correctly back- and forth between JS and Flash .

    Revision: 13042
    Revision: 13042
    Author:   [email protected]
    Date:     2009-12-17 03:45:27 -0800 (Thu, 17 Dec 2009)
    Log Message:
    Fix for FM-287, reinstating the main sample (that uses serial and parallel composition), and making another pass at  getting all the changed trait methods mapped correctly back- and forth between JS and Flash.
    Ticket Links:
        http://bugs.adobe.com/jira/browse/FM-287
    Modified Paths:
        osmf/trunk/apps/samples/framework/HTMLGatewaySample/HTMLGatewaySample.as
        osmf/trunk/apps/samples/framework/HTMLGatewaySample/html-template/index.template.html
        osmf/trunk/framework/MediaFramework/org/osmf/external/HTMLElement.as
        osmf/trunk/framework/MediaFramework/org/osmf/gateways/HTMLGateway.as

    Perre wrote:I'm used to being able to pick one or a couple of songs and then adding it a specified playlist. Is this impossible in sonata?
    It's clearly not impossible, just different than you expect. Create your playlist as you want it to appear in the Current tab (meaning don't dump every single song from your library in there, just the ones you want) and then save the playlist.
    Perre wrote:And if I try to play the m3u file created (the one with every song listed) through freevo I get a message that the directory is empty. What am I doing wrong??
    Look at save_absolute_paths_in_playlists in your mpd.conf.

  • Generate a report from the grid to get all the 10g instance name and size

    Hi Guru
    Greetings foe the day
    can you help me to Generate a report from the grid to get all the 10g instance name and size.
    If its passible you would help me a ton
    Thank you

    If you can see in you query, you asking to view dba_segments for one instance and the other query is over the MGMT$DB_TABLESPACES view but NOT "WHERE" clouse is using, and if ypu have more once instance then than view sum all the tablespaces sizes.
    How many instanced are registed in your grid control?
    http://www.jpuga.cl
    Regards
    user625256 wrote:
    Hi
    can any one help on this
    The o/p
    SQL> select sum(bytes)/1024/1024/1024 from dba_Segments;
    SUM(BYTES)/1024/1024/1024
    3549.80879
    when i query from the above mgmt its returns 1,507,473.149 GB
    select target_name DB_NAME,host_name Host,sum(trunc(tablespace_used_size/1024/1024/1024,2)) size_GB
    from MGMT$DB_TABLESPACES group by host_name,target_name order by target_name
    it gives the size as 1,507,473.149 GB
    Thank you in advance

  • Get all the members having particular UDA's

    Hi,Is there any way in Essbase Java API to get the members which are having any of the UDA's given in a list? For example, If I have three UDA's UDA1, UDA2, UDA3. Now I want to get the members in a cube which are having any of these UDA's attached to it. I knowIEssMemberSelection.executeQuery(mbrName, queryType, queryOptions, dimName, UDAName, input2) will give me the members which are having UDAName which attached as UDA. I am looking for a method which can return me all the members if I give the arguements as an array

    No, there isn't a function that takes an array of UDAs and returns members that has one of the UDAs in the array. However, you can do the member selection multiple times, once for each UDA, and gather the info about the members that you need.Tim TowApplied OLAP, Inc.

  • Powershell to get all the members in about 20 DynamicDistribution group in exchange 2010

    I have about 20 DynamicDistribution groups in my exchange 2010 enviroment.  I need to run a report to show all the members in each group.  How can I accomplish this with powershell ?  thanks for all the help

    I assume you don't want the output of all 20 groups dumped into one single list.  So, you'd just use this:
    Use the Shell to preview the list of members of a dynamic distribution
    group
    This example returns the list of members for the dynamic distribution group Full Time Employees. The first command stores the dynamic distribution group object in the variable $FTE.
    The second command uses the Get-Recipient cmdlet to list the recipients that match the criteria defined for the dynamic distribution group.
    $FTE = Get-DynamicDistributionGroup "Full Time Employees"
    Get-Recipient -RecipientPreviewFilter $FTE.RecipientFilter
    For detailed syntax and parameter information, see Get-DynamicDistributionGroup and Get-Recipient.
    Mike Crowley | MVP
    My Blog --
    Baseline Technologies

  • Java 1.5 get all the resources  with dialogs and xp die

    Hi installed java 1.5 and get all the windows xp memory resources when try to open some dialogs in netbeans 4.0 and dbvisualizer...
    i had to uninstall it to keep working
    any idea?
    Ty
    Bruno

    more memory

  • Get all the local variables

    Hi,
       I found several API calls to get/set the local variables, if i know the name of the variable. However, if i want to get the list of variables from locals, parameters etc., how should i be able to get this from "ThisContext".
    Thanks,
    Regards,
    Aparna

    Hi,
    This example may help
    http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=BCB5C685D37F104AE034080020E74861&p_...
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • My partner has lost her phone how does she get all the music pics back and into a new iPhone?

    My partner has lost her phone but how does she get her iTunes music that she has bought back onto her new iPhone?

    That won't do the trick. You really need the computer. That way all your data and files can be backed up when you backup the computer.
    Your only other option, which is much more limited, is using iCloud:
    iCloud- Backup and restore overview
    iCloud- Restore
    iCloud- Restore your iOS device from iCloud
    iCloud- iCloud Backup
    iCloud- Back up your iOS device to iCloud

  • I'm trying to download ios 5 its gets all the way done downloading and then says theres an error in my network, i've tried to download it 8 times, what can i do?

    I  need help setting up my iso 5 i just keep getting an error message after its already fully loaded, it says error with network.

    If you have a Windoze PC, try temporarily disabling the antivirus, anti-adware, anti-spyware, and any other anti-whatever that is running and required with that secure OS before beginning the download.

  • HT1212 My sons old iPad 1 is rarely used, but, when i charged it up the message was "iPad is disabled try again in 22,824,852 minutes"  sorry but thats a bit of a wait!  I have gone through all the various reset methods but can't get around the disabled s

    Hello,
    My sons old iPad 1 is rarely used, but, when i charged it up the message was;  "iPad is disabled try again in 22,824,852 minutes"  sorry but thats a bit of a wait! 
    I have gone through all the various reset methods but can't get around the disabled status??
    Can't see another way to reset it.
    Could it be for the bin.
    Only wanted to give the youngest daughter the iPad to take to school.
    Hope someone can help
    Thanks
    Jonny Burns.

    Is this how you do it?
    1. Turn off iPad. Press and hold the Sleep/Wake button for a few seconds until the red slider appears, slide to turn off.
    2. Connect USB cable to computer
    3. Press and hold the Home button down and connect the docking end of cable to iPad
    4. Continue holding the Home button until you see the "Connect To iTune" screen
    5. Release the Home button
    6. Open iTune (make sure you have the newest version of iTune)
    7. You should see "iTunes has detected an iPad in recovery mode"
    8. Use iTune to restore iPad
    Note: You need to be patient and repeat the above many times to recover your iPad

  • I plug my iPhone 3gs into my laptop and it no longer syncs with my iTunes.  Ive tried all the trouble shooting methods and nothing works.  My iPhone doesnt appear on iTunes or under "my computer." Does anyone know how to fix this?

    I plug my iphone 3gs into my laptop and it no longer syncs with my iTunes.  I've tried all the trouble shooting methods and nothing works.  My iPhone doesn't appear on iTunes or under "My Computer." Does anyone know how to fix this?

    If AMDS is running, you are using a USB port directly on the computer and not a hub, you have disconnected other USB devices except keyboard and mouse, you have completely uninstalled and reinstalled iTunes as described in http://support.apple.com/kb/HT1925, You have tried cleaning the connector on the bottom of the phone, you have tried a different cable, you have installed the latest USB drivers for your computer, you have disabled your antivirus and firewall, you are running as an Administrator account and you have tried creating a new user on your computer and connected when logged in as that user then you have exhausted my knowledge. The only other thing to try is a different computer. If it isn't recognized on a different computer you have a hardware problem. Good luck!

  • Get all the variables declaration in a program

    Is there a possible way to get all the variables declarations ( name and type ) inside a java program and not only the fields that you can easily get with reflection mechanism but also local variables inside a method?

    Kayaman wrote:
    Jigsaw23 wrote:
    local variables inside a method?Nope, you'd have to get inside the call stack for that and there's no easy mechanism for that.Even that wouldn't do it, since not all code is on the call stack at all times. There are ways to do it, using bytecode engineering, but I'm not going to get into that because if you don't already know how to do it, I doubt you have a problem that genuinely requires it.
    It's a bogus requirement anyway. Whatever you're trying to do, OP, it's doomed to failure. What are you trying to do? I mean, what were you doing that led to you thinking "If I knew what those local variable were, I'd manage it!"?

  • Get All Control Values [Variant] Method for Global Vars

    Hello,
    to get all the data of controls use in a VI, the methode "Get All Control Values [Variant]" can be used fine.
    Is anything else available for gloabl variables which are use by this VI?
    Thanks.

    Yes, I tried to link this methode to the vi which contains the global vars but got the error message
    "you cannot make a strict vi refernce to a global VIs.
    Any other idea?
    Thanks, Thomas.
    Message Edited by maximint on 05-30-2007 08:41 AM
    Attachments:
    Untitled.vi ‏40 KB

  • I bought a new laptop how do I sync my ipad and get all the files synced to my old laptop

    I bought a new laptop. Can I sync my ipad to it?  And how do I get all the files that were synced to my old laptop?

    Do you still have your old computer with your media (music, films, etc) on it so that you can copy them over from it ? If you do then there are a number of methods on this page for how you could copy it over from it : http://support.apple.com/kb/HT4527
    If not, and if you don't have your content elsewhere (e.g. music that wasn't bought from iTunes), then there are some programs listed half-way down this page for how to copy content back from a device : https://discussions.apple.com/docs/DOC-3991
    For iTunes downloads you should be able to copy them from your iPad via File > Devices > Transfer Purchases
    Also see this page for syncing to a new computer : https://discussions.apple.com/docs/DOC-3141
    If you want to copy files/documents from the iPad then how you do so depends upon what app that they are in and what the app supports e.g. file sharing on the Apps tab in iTunes, transfer via your wifi network, email, dropbox etc

  • How to get all the values of a variable with F4 with checkboxes to select

    Dear Experts,
    After Executing a query by giving let 3 values(Out of 10 Values) to a variable.
    To give 2 more input values to the same variable(i.e.,total I wanted to give 5 inputs this time ),after refreshing the query,for that variable if I click F4, I am seeing the historical values(i.e.,3) and remaining 7 values also But with out any Check Boxes besides them to select the 2 inputs.
    In the same F4 Screen, If I click all values(an Icon at The bottom),then also Im seeing but no check Box.
    I hve tried by deleting the Delete Personalization also,but no use.
    Please tell me How to get all the values with F4 with check boxes to select ,whatever I want??
    Thanks in advance

    Take a look at the InfoObject and go to the Business Explorer tab. If the 'Query Def. Filter Value Selection' is set to 'Only Values in InfoProvider', you're only going to get the values in F4 that exist in the InfoProvider, not everything in the Master Data. This would need to be changed to the value of 'Values in Master Data Table' if you want it to show everything possible when F4 is chosen.
    Likewise, you're going to need to look at the query and go to the Advanced tab for the InfoObject. Make sure that the radio button for 'Values in Master Data Table' is selected. If not, then you should change that selection.

Maybe you are looking for

  • Can't sync photos with photoshop elements 11 album

    I just upgraded to photoshop elements 11. When I attempt to sync photos in iTunes (to synch with my iPhone), Photoshop Elements appears in the drop down and when I select it, it finds all the "albums" in the catalog. However, when I select an album t

  • KNOWN ISSUE: Problem using GET_PRINT_DOCUMENT to produce multiple PDFs.

    Hi Folks I'm calling a report stored in APEX (Shared Components Report Query & Layout) many times using a loop in a process on my page. At each iteration of the loop I am updating the value of a hidden text item on the page which is the one and only

  • GREP Expression help

    I am new to using GREP and have a find/replace scenario that I'm having trouble with. I have a list of names with middle initials, but no period. I'd like to find the capital middle initial and replace it with the found text, plus a period. I have pr

  • Burning DVD Plug-in?

    When I open iDVD 6 it says that that i don't have the plug-in to burn a DVD. What plug-in do I need? Where can I get it?

  • Create PHP form from MySQL table structure

    Hi folks Not directly DW related, but .... Anybody got any recommendations for a utility which would create a quick head start by creating the php/html code for a basic form using the field structure of a MySQL table ? Thanks for any suggestions. Ron