I'm using reflection to dynamically get class information specifically their method definitions. Here are some examples of the method definitions I'll be getting,
"public final native void java.lang.Object.wait(long) throws java.lang.InterruptedException"
...
"public final native java.lang.Class<?> java.lang.Object.getClass()"
As you can see they're all unique, some have exceptions, parameters, etc. What would be the best way to parse through each string and get the method name?
My idea is that I could find the character (
and then backtrack until the first space saving a new string from that space to the (
character.
Will I run into a problem with this solution or is there an easier more elegant way to achieve what I want?
Update:
Each method declaration is contained in a separate string. This is a string problem rather than a reflection problem, I only mentioned reflection so you knew how I was getting this information dynamically. All I need to do is parse the string for the method name.