How to found which class or method contain specific annotation?

Ads
 

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
How do I resolve this Java Class not found exception?
class not found exception
class not found error - JDBC
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
Getting Fields Information of a class
class method in java
Java Abstract Class Example
How to change the value of a variable which is set in jsp (by jstl method) by calling the function from js?
Which method is more efficient?
How to remove specific element from Hashset.
java profram:error 405 method not found
If Sessin Contain Array how can i get each value.
which class is super class to all classes
Class and method question, Java?
Annotations
Hibernate Validator Annotations
How to extract the entire line with specific data from a Text in java?
How will you load a specific locale? - Java Beginners
JDBC Class Not Found Exception
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

Ads