Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone!
I am trying to make a compiler for a custom file format my editor uses, and I want it to be able to handle custom classes automatically. I already know how to find a class by name, but I want to know if it's possible to detect what parameters the classes constructor takes in, if it's not possible I will have to use String[] args or something like that and create a util class to read the input externally.

Thanks in advance!
Posted
Comments
Richard MacCutchan 11-Apr-14 5:01am    
Since the compiler and the file format are yours, and you have provided no details about either of them, it's impossible for us even to begin to guess what the issue might be.
HuggableAlien 11-Apr-14 5:07am    
Basically what I'm asking is: is there a java function I can use, which can get me the parameters of a function? I know Constructor has a function called getParameterTypes which gives you an array of objects, but can you detect their names with some function?
Richard MacCutchan 11-Apr-14 5:18am    
Get it from where? You really need to make your problem clearer in terms of coding, inputs and outputs.
HuggableAlien 11-Apr-14 5:24am    
I'm mainly trying to get the parameter names of constructors. I don't know how I can do it, or if I even can, that's why I'm asking here if it's even possible to somehow get the names of parameters in a constructor
Richard MacCutchan 11-Apr-14 5:26am    
Yes, look at the code and you will see them detailed. Or, read the documentation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900