How to found which class or method contain specific annotation?

How to found which class or method contain specific annotation?

Suppose we are having a class with separate user define annoation in same package like

@One

class A {

}

@Two

class B {

}

@One

class C {

}

How will I find which class is using @one annotation and which @Two?

OR

We are having a class in which methods are annotated and i want to retrieve which annotation is having which annotation

like :

class A {

@two

public method1() {

}

@one

public method2() {

}

@two

public method3() {

}

}

Any other idea to do something like this will be appreciated. Any help will be appreciated I am using core java reflection and annotations.

Original Scenario:-

Suppose i am having a class testcases having GUI ,Functional and others these three categories of testcase. i want to found method or class according to category and execute that method or class which ever is possible.

View Answers

Ads









Related Tutorials/Questions & Answers:
How to found which class or method contain specific annotation?
Example for a method in java which returns a class
Advertisements
class not found exception
How do I resolve this Java Class not found exception?
com.thinkaurelius.titan.diskstorage.hbase.HBaseStoreManager class not found
CLASS NOT FOUND EXCEPTION
How to call the run method from another class?
unable to import class com.opensymphony.xwork2.ActionContext not found
Error:No Class Found Exception:org.postgresql.driver
JSP error: class UserForm not found in class model.UserAction
Java Abstract Class Example
class method in java
Getting Fields Information of a class
Class and method question, Java?
which class is super class to all classes
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
java profram:error 405 method not found
How to remove specific element from Hashset.
If Sessin Contain Array how can i get each value.
Which class is extended by all other classes?
javascript call action class method instruts
JDBC Class Not Found Exception
Java toUpperCase() Method
JavaScript insertData method
how to call static method
how to call static method
how to call static method
how to call static method
how to call static method
how to call static method
How to extract the entire line with specific data from a Text in java?

Ads