08-24-2011 05:54 PM
I have a library that was complied for BlackBerry JRE. The task is to extract all the methods and their parameters and types.I would like to use it to automate my code creation process.
There is a solution using with the java.util.reflection. It will not work on BB JRE for the known JavaME descendance.
Can I do the same thing in Eclipse or any other way, may be preprocessor? I would like to have a list of methods and parameters from a jar file. Can this be done outside the compilation process?
I other words, do I need the BB JRE to get access to that library complied for BB? Can I use it with a JavaCE JRE/JDK?
08-25-2011 04:51 PM
08-25-2011 05:16 PM
HI rcmaniac25 !
Thanks for your time. Well, I do not know how the jar was compiled. It came as a single jar. Even if it is compiled for BB with a COD, somehow Eclipse can show its' methods and parameters in the project explorer view. What does it use then? Can it be I do not need the reflection?
Here is the library just in case https://www.x.com/servlet/JiveServlet/downloadBody
08-26-2011 11:04 AM
Ok, I checked the JAR you linked, you could do reflection with it as long as the reflection isn't expected to run on BlackBerry (BlackBerry doesn't have reflection capabilities right now, but you said you wanted to do reflection outside of the project).
The general explanation for why you can see the classes, methods, etc. is that it's a normal JAR file (just compiled under J2ME constraints, which means it will work on BlackBerry).
Compiling for BlackBerry
JAR (normal java program/library) -> RAPC -> JAR and COD.
The JAR file that RAPC produces will look like a normal java program/library, but if you try to run it, it will not work. The COD file, well that's self explanatory, it won't work on anything bug a BlackBerry.
That is why I specified if it's a JAR file that was compiled with a COD file. It is there so that you can link to it with Eclipse/JRE and use the classes/functions/etc.