Results 1 to 20 of 25
Thread: Reuse Call Hierarchy API
- 02-09-2017, 07:49 AM #1
Member
- Join Date
- Feb 2017
- Posts
- 6
- Rep Power
- 0
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
- 02-09-2017, 09:19 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
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.Please do not ask for code as refusal often offends.
** This space for rent **
- 02-09-2017, 10:39 AM #3
Member
- Join Date
- Mar 2016
- Location
- 9345 Cemetery Dr. Scarsdale
- Posts
- 5
- Rep Power
- 0
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.
- 02-09-2017, 01:56 PM #4
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,172
- Rep Power
- 12
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,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 02-10-2017, 05:51 AM #5
Member
- Join Date
- Feb 2017
- Posts
- 6
- Rep Power
- 0
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
- 02-10-2017, 09:15 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
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 **
- 02-10-2017, 10:57 AM #7
Member
- Join Date
- Feb 2017
- Posts
- 6
- Rep Power
- 0
Re: Reuse Call Hierarchy API
Does it mean that the method cannot be invoked and has to be written manually?
- 02-10-2017, 11:16 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
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 **
- 02-10-2017, 01:58 PM #9
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,172
- Rep Power
- 12
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,
JimThe JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
- 02-13-2017, 05:36 AM #10
Member
- Join Date
- Feb 2017
- Posts
- 6
- Rep Power
- 0
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.
- 02-13-2017, 10:52 AM #11
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
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 **
- 02-13-2017, 12:36 PM #12
Re: Reuse Call Hierarchy API
Also posted at: Reuse Call Hierarchy API - Java | Dream.In.Code
If you don't understand my response, don't ignore it, ask a question.
- 02-17-2017, 05:21 AM #13
Member
- Join Date
- Feb 2017
- Posts
- 6
- Rep Power
- 0
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
- 02-17-2017, 08:00 AM #14
Re: Reuse Call Hierarchy API
Last edited by SurfMan; 02-17-2017 at 10:17 AM.
"It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2™ © 2013
- 02-17-2017, 09:21 AM #15
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
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 **
- 02-17-2017, 10:34 AM #16
- 02-17-2017, 11:16 AM #17
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
- 02-17-2017, 11:23 AM #18
Moderator
- Join Date
- Apr 2009
- Posts
- 13,541
- Rep Power
- 25
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 **
- 02-17-2017, 12:48 PM #19
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
- 02-17-2017, 02:49 PM #20
Senior Member
- Join Date
- Jan 2013
- Location
- Northern Virginia, United States
- Posts
- 6,172
- Rep Power
- 12
Re: Reuse Call Hierarchy API
The JavaTM Tutorials | SSCCE | Java Naming Conventions
Poor planning on your part does not constitute an emergency on my part
Similar Threads
-
Struts: Reuse data across multiple ActionForms problem
By Tequila_Burp in forum Web FrameworksReplies: 3Last Post: 12-12-2012, 10:04 AM -
Need to reuse a long piece of coding again in the program
By Nixter1997 in forum New To JavaReplies: 1Last Post: 10-20-2012, 10:40 AM -
Help with inheritance/hierarchy
By klz215 in forum New To JavaReplies: 2Last Post: 02-23-2012, 08:42 PM -
Reuse a list of Integers
By Dan0100 in forum New To JavaReplies: 6Last Post: 08-19-2010, 07:47 PM -
Object Reuse
By sankarguru in forum Advanced JavaReplies: 4Last Post: 03-25-2009, 05:21 AM
Bookmarks