i use the following code to get the methods declared in a class. but the code returns the unnecessary values as well the declared methods too.
following is my code :
EDIT :
Class cls;
List classNames = hexgenClassUtils.findMyTypes("com.hexgen.*");
Iterator<Class> it = classNames.iterator();
while(it.hasNext())
{
Class obj = it.next();
System.out.println("Methods available in : "+obj.getName());
System.out.println("===================================");
cls = Class.forName(obj.getName());
Method[] method = cls.getDeclaredMethods();
int i=1;
Method[] method = cls.getDeclaredMethods();
int i=1;
for (Method method2 : method) {
System.out.println(+i+":"+method2.getName());
}
}
I have also tried with getMethods()
following is my output :
1:ajc$get$validator
2:ajc$set$validator
3:ajc$get$requestToEventTranslator
4:ajc$set$requestToEventTranslator
5:ajc$interMethodDispatch2$com_hexgen_api_facade_HexgenWebAPIValidation$validate
6:handleValidationException
after this only i get the methods i have declared in class i give. What are the above values and how to avoid them.?.
Best Regards