Created
February 13, 2016 16:08
-
-
Save AnnaBoro/c41c2c19167adb570ceb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lesson7_10.reflection; | |
import java.lang.annotation.Annotation; | |
public class ApplicationManager { | |
public void runManager(Class sclass) { | |
Annotation[] annotations = sclass.getAnnotations(); | |
for (Annotation annotation : annotations) { | |
if (annotation.annotationType().getSimpleName().equalsIgnoreCase("service")) { | |
System.out.println("Class " + sclass.getSimpleName() + " has @Service"); | |
} | |
else { | |
System.out.println("Class " + sclass.getSimpleName() + " doesn't have @Service"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment