What I'm trying to do is have a folder with classes in it. Then be able to loop through those classes, and trigger a method named "String getVariables(Object player, String line)".
But I have no clue where to start...
What I'm trying to do is have a folder with classes in it. Then be able to loop through those classes, and trigger a method named "String getVariables(Object player, String line)".
But I have no clue where to start...
I will not provide you with code but i will send you in a direction which will resolve your issue.
1: Locate the files(Which are Classes), store them in an array if you want.
2: Create a ClassLoader/URLClassLoader and set the url to the path of the file{http://docs.oracle.com/javase/7/docs/api/java/net/URLClassLoader.html}
3: Depending on what the access of the method is(Static/Instance) you will either need to create an instance of that class or just invoke the static method, this can be acomplished with reflection{http://docs.oracle.com/javase/tutorial/reflect/}
This question has been asked a few times or questions similar to yours.
Method to dynamically load java class files
Java: How to load Class stored as byte[] into the JVM?
How do I invoke a Java method when given the method name as a string?
I hope this helps you!