method.invoke(...) requires an array of arguments that could actually be used to call the method. In this case, you give it {null}, which works for any function that accepts a single Object, but no other functions. To call arbitrary functions, you need to match the length of the parameter list to the number of arguments the function needs:
method.invoke(..., new Object[method.getParameterTypes().length])
This still has a few problems. First, the first parameter of invoke is not the class as you entered it, but instead an instance of an object of that class (or null, for static methods). You would need to search through the class's constructors and construct an instance of that class before you could call instance methods of that class. The second problem is that this does not work with functions that require primitives, which cannot be null. You could check the classes of the parameters and replace null with 0 or false as appropriate. The third, most important problem, which is the reason that it is so difficult to do this, is that you do not actually want to invoke the method. You want to retrieve information about the method, which in this case happens to be stored inside the method. The proper solution is to just store the information attached to the method, with an annotation:
@Retention(RetentionPolicy.RUNTIME)
@interface ID {
int value();
}
...
@ID(1337)
void exampleMethod() { ... }
...
newIdentifier = method.getAnnotation(ID.class).value(); //returns 1337 for exampleMethod