Our teacher asked us to make a method which takes a Class as a parameter then checks the fields and methods if they follow the rules of Checkstyle (Upper case, lower case, final attribute, etc.)
He gave us a piece of code to start with but I don't know what to do next.
public class CheckStyle {
static String valider(Class c){
Field[] tattribut = c.getDeclaredFields();
String name = c.getName();
Method[] tmethod=c.getDeclaredMethods();
}
public static void main(String[] args) {
String error = CheckStyle.valider(a.class);
System.out.println(error);
}
}
Try to use some of this code:
Then go over your fields to see if they are in the correct format you need and ect.