Page 1 of 2 12 LastLast
Results 1 to 20 of 25
Like Tree1Likes

Thread: Reuse Call Hierarchy API

  1. #1
    Aruna Devi is offline Member
    Join Date
    Feb 2017
    Posts
    6
    Rep Power
    0

    Default Reuse Call Hierarchy API

    Hi

    To find the callers and callees of a method, Eclipse provides Open Call Hierarchy(Ctrl+Alt+H)

    I would like to invoke the Call hierarchy from my program where it performs the same operation

    If there are any possibilities to do so, direct me to the right path

    Thanks in advance

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    The place I would look would be the org.eclipse.jdt package. I think that's where this sort of code analysis/searching stuff lives.

    I've never used it, though, but you should be able to find documentation over on the Eclipse site for it.
    jameswarner likes this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #3
    jameswarner is offline Member
    Join Date
    Mar 2016
    Location
    9345 Cemetery Dr. Scarsdale
    Posts
    5
    Rep Power
    0

    Default Re: Reuse Call Hierarchy API

    I agree to correct path “org.eclipse.jdt” to store file reuse call Hierarchy API. Just need two method create call and caller method to open similar time to call Hierarchy API.

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,144
    Rep Power
    12

    Default Re: Reuse Call Hierarchy API

    Do you actually want to call Eclipse's version of this from your program or do you want to write your own version of that capability? I presume the former would only work within the Eclipse environment.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  5. #5
    Aruna Devi is offline Member
    Join Date
    Feb 2017
    Posts
    6
    Rep Power
    0

    Default Re: Reuse Call Hierarchy API

    I just want to invoke the Eclipse API of Call Hierarchy from my program, rather than writing the same functionality

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    Bear in mind that it is quite likely this call chain requires the code analysis part of Eclipse, which itself possibly requires the source code.
    I don't know, but I wouldn't be surprised.
    You know all that indexing Eclipse does? It's for stuff like this.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Aruna Devi is offline Member
    Join Date
    Feb 2017
    Posts
    6
    Rep Power
    0

    Default Re: Reuse Call Hierarchy API

    Does it mean that the method cannot be invoked and has to be written manually?

  8. #8
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    No, but it means you'll have to look into exactly what it needs to do its job.
    The above is a bit of guesswork on my part, but I'd be surprised if it didn't need more than a simple method call. It has to be able to analyse the code somehow.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  9. #9
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,144
    Rep Power
    12

    Default Re: Reuse Call Hierarchy API

    You have explained what you want to do but you haven't explained why. Since this can be used from Eclipse directly you already have the capability. What are you trying to achieve in doing this? For what purpose? Sometimes there might be easier alternatives.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  10. #10
    Aruna Devi is offline Member
    Join Date
    Feb 2017
    Posts
    6
    Rep Power
    0

    Default Re: Reuse Call Hierarchy API

    The aim is to develop a code change impact analysis tool. As a first step, I need to get the hierarchy of the particular method which is being modified and then have to proceed further.

  11. #11
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    So this will be an Eclipse plugin?
    If that's the idea then you need to read up on how plugins work for that IDE. Not written one myself, though.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  12. #12
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,904
    Rep Power
    30

    Default Re: Reuse Call Hierarchy API

    If you don't understand my response, don't ignore it, ask a question.

  13. #13
    Aruna Devi is offline Member
    Join Date
    Feb 2017
    Posts
    6
    Rep Power
    0

    Default Re: Reuse Call Hierarchy API

    I just thought of using all available resources, that's why posted in a different forum.

    What I'm trying to develop is a eclipse plugin, since Call Hierarchy is a internal to eclipse I couldn't figure out any kind of documentation to understand how it is working.

    Still under confusion how to take the process to next step

  14. #14
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,939
    Rep Power
    7

    Default Re: Reuse Call Hierarchy API

    Quote Originally Posted by Aruna Devi View Post
    I just thought of using all available resources, that's why posted in a different forum.
    We know why people post in multiple forums. The thing is, if you would post the links to those posts too, then we can check if there is an answer given. Otherwise you would be wasting our valuable time with a problem that is already solved.
    Last edited by SurfMan; 02-17-2017 at 11:17 AM.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  15. #15
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    Have you looked at the JDT project, as I suggested?
    That's where this stuff lives.
    JDT Core Component

    As it says there:
    JDT Core is the Java infrastructure of the Java IDE. It includes ... A Java Model that provides API for navigating the Java element tree. The Java element tree defines a Java centric view of a project. It surfaces elements like package fragments, compilation units, binary classes, types, methods, fields ... An indexed based search infrastructure that is used for searching, code assist, type hierarchy computation, and refactoring. The Java search engine can accurately find precise matches either in sources or binaries.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  16. #16
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    12,059
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    Quote Originally Posted by SurfMan View Post
    ... valuable time ...
    Huh?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  17. #17
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,939
    Rep Power
    7

    Default Re: Reuse Call Hierarchy API

    Just for the sake of alternative options, have you thought about using Aspect Oriented Programming (AOP). AspectJ is a nice place to start, and specifically designed for situations like this.

    Example here: Java Method Logging with AOP and Annotations.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  18. #18
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,532
    Rep Power
    24

    Default Re: Reuse Call Hierarchy API

    This is for a plugin, so I'm presuming it isn't around logging or anything.
    The OP simply wants to access the Eclipse API so they can use the call hierarchy functionality.

    This doesn't sound like an app, as such.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  19. #19
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,939
    Rep Power
    7

    Default Re: Reuse Call Hierarchy API

    Right, I missed that part. I though he wanted to use the Eclipse code in his own application. Can't help you there. I am not an Eclipse man.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013

  20. #20
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,144
    Rep Power
    12

    Default Re: Reuse Call Hierarchy API

    Quote Originally Posted by DarrylBurke View Post
    Huh?

    I agree. I think he meant ".. Jim's valuable time.."

    Regards.
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

Page 1 of 2 12 LastLast

Similar Threads

  1. Struts: Reuse data across multiple ActionForms problem
    By Tequila_Burp in forum Web Frameworks
    Replies: 3
    Last Post: 12-12-2012, 11:04 AM
  2. Replies: 1
    Last Post: 10-20-2012, 11:40 AM
  3. Help with inheritance/hierarchy
    By klz215 in forum New To Java
    Replies: 2
    Last Post: 02-23-2012, 09:42 PM
  4. Reuse a list of Integers
    By Dan0100 in forum New To Java
    Replies: 6
    Last Post: 08-19-2010, 08:47 PM
  5. Object Reuse
    By sankarguru in forum Advanced Java
    Replies: 4
    Last Post: 03-25-2009, 06:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •